A github action to verify that certian files changed during the workflow execution.
on:
pull_request:
branches:
- master
jobs:
node-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Change text file
run: |
echo "Modified" > new.txt
- name: Change file in directory
run: |
echo "Changed" > test_directory/new.txt
- name: Verify Changed files
uses: tj-actions/verify-changed-files@v5
id: changed_files
with:
files: |
new.txt
test_directory
.(py|jpeg)$
.(sql)$
^(mynewfile|custom)
- name: Perform action when files change.
if: steps.changed_files.outputs.files_changed == 'true'
run: |
echo "Do something when files have changed."
| Input | type | required | default | description |
|---|---|---|---|---|
| token | string |
true |
${{ github.token }} |
github action default token or PAT token |
| files | array |
true |
List of file(s)/directory names (regex optional) to check for changes during workflow. execution |