A GitHub Action to verify file changes that occur during workflow execution.
- Lists all files that changed during a workflow execution
- Fast execution
- Scales to large repositories
- Supports all platforms (Linux, macOS, Windows)
- Does not use external dependencies
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Change Files
run: |
echo "test" > test/new.txt
echo "test" > unstaged.txt
- name: Get Changed Files
id: verify-changes
uses: zyactions/verify-changed-files@v2
- name: Run only if one of the files has changed
if: steps.verify-changes.outputs.changed-files != ''
run: |
echo "Changed Files:"
echo "${{ steps.verify-changes.outputs.changed-files }}"
- name: Run only if 'unstaged.txt' has changed
if: contains(steps.verify-changes.outputs.changed-files, 'unstaged.txt')
run: |
echo "Detected changes to 'unstaged.txt'"steps:
- name: Checkout
uses: actions/checkout@v3
# ...
- name: Get Changed Files
id: stage1
uses: zyactions/verify-changed-files@v2
with:
return-pipe: true
- name: Filter Results
id: stage2
uses: zyactions/glob@v2
with:
pattern: |
test/*
unstaged.txt
pipe: ${{ steps.stage1.outputs.pipe }}
- name: Print
run: |
echo "Changed Files:"
echo "${{ steps.stage2.outputs.matches }}"Check out the glob cheat sheet or the zyactions/glob action for further details.
Configures the action to exclude .gitignore ignored files for added files detection. This option is enabled by default.
Enable this option to return a shell (bash) command in the pipe output that can be used for piping.
The output command must be evaled to return the results. It can also be passed to other actions that support a pipe input.
Note: The
changed-filesoutput will not be populated if this option is enabled.
This output contains all files detected by the action, separated by the configured separator. Contains the empty string if no changes were detected.
Note: This output is only available if the
return-pipeoption is not enabled.
A shell (bash) command which can be used for piping.
Note: This output is only available if the
return-pipeoption is enabled.
This action does not use external GitHub Actions dependencies.
Versions follow the semantic versioning scheme.
Verify Changed Files Action is licensed under the MIT license.