Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jackton1 committed Jun 28, 2023
1 parent 927a8c5 commit 89890d6
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,18 +93,23 @@ on:
- main

jobs:
# -------------------------------------------------------------
# Using GitHub's API
# -------------------------------------------------------------
# Event `pull_request`: Returns all changed pull request files.
# --------------------------------------------------------------
job1: # Example 1 - Using GitHub's API
# NOTE:
job1:
# NOTE:
# - This is limited to pull_request* events and would raise an error for other events.
# - A maximum of 3000 files can be returned.
# - For more flexibility and no limitations see "Using local .git directory" below.

runs-on: ubuntu-latest # windows-latest | macos-latest
name: Test changed-files
if: github.event_name != 'push'
permissions:
pull-requests: read

steps:
- name: Get changed files
id: changed-files
Expand All @@ -116,11 +121,13 @@ jobs:
echo "$file was changed"
done
# ------------------------------------------------------------------------------------------------------------
# Using local .git directory
# ------------------------------------------------------------------------------------------------------------
# Event `push`: Compare the preceding commit -> to the current commit of the main branch.
# Event `pull_request`: Compare the last commit of main -> to the current commit of a Pull Request branch.
# ------------------------------------------------------------------------------------------------------------
job2: # Example 2 - Using local .git directory
job2:
runs-on: ubuntu-latest # windows-latest | macos-latest
name: Test changed-files
steps:
Expand All @@ -142,7 +149,7 @@ jobs:
echo "$file was changed"
done
job3: # Example 3 - Using local .git directory
job3:
runs-on: ubuntu-latest # windows-latest | macos-latest
name: Test changed-files
steps:
Expand All @@ -162,7 +169,7 @@ jobs:
echo "One or more files in the docs folder has changed."
echo "List all the files that have changed: ${{ steps.changed-files-specific.outputs.all_changed_files }}"
job4: # Example 4 - Using local .git directory
job4:
runs-on: ubuntu-latest # windows-latest | macos-latest
name: Test changed-files
steps:
Expand All @@ -185,7 +192,7 @@ jobs:
echo "One or more .js file(s) or any file in the static folder but not in the doc folder has changed."
echo "List all the files that have changed: ${{ steps.changed-files-excluded.outputs.all_changed_files }}"
job5: # Example 5 - Using local .git directory
job5:
runs-on: ubuntu-latest # windows-latest | macos-latest
name: Test changed-files
steps:
Expand Down

0 comments on commit 89890d6

Please sign in to comment.