https://github.com/avraammavridis/files-changed-action
Expose a list of changed files between origin / master
https://github.com/avraammavridis/files-changed-action
Last synced: 3 days ago
JSON representation
Expose a list of changed files between origin / master
- Host: GitHub
- URL: https://github.com/avraammavridis/files-changed-action
- Owner: AvraamMavridis
- Created: 2020-09-18T04:42:59.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-09-18T11:10:39.000Z (about 5 years ago)
- Last Synced: 2025-09-20T17:35:35.926Z (24 days ago)
- Language: JavaScript
- Size: 334 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# files-changed-action
This github action exposes the files and file extensions of the changed files comparing the current branch versus a target branch (default master)
This is helpful if you want to skip certain steps on your workflow depending on the files that have changed, to decrease the execution time of your workflows.### How to use
Install action and specify id
```
- name: Get list of changed files
uses: AvraamMavridis/files-changed-action@v3
id: changed_files
```Optionally specify target branch
```
- name: Get list of changed files
uses: AvraamMavridis/files-changed-action@v3
id: changed_files
with:
target_branch: staging
```The action exposes 2 outputs
`steps.changed_files.outputs.CHANGED_FILES`
and
`steps.changed_files.outputs.CHANGED_FILES_EXTENSIONS`
execute your steps based on the files that changed
```
- name: Get list of changed files
uses: AvraamMavridis/files-changed-action@v3
id: changed_files
with:
target_branch: staging
- name: Get extensions of changed files
if: "contains(steps.changed_files.outputs.CHANGED_FILES_EXTENSIONS, 'js')"
run: echo JS files changed
```