3
0
Fork 0
mirror of https://github.com/tj-actions/changed-files synced 2024-12-16 19:27:39 +00:00

Update README.md

This commit is contained in:
Tonye Jack 2021-04-24 04:55:30 -04:00 committed by GitHub
parent 38710bc67f
commit 801d25f3b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -54,27 +54,6 @@ on:
push:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
name: Test changed-files
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # OR "2" -> To retrieve the preceding commit.
- name: Get changed files
id: changed_files
uses: tj-actions/changed-files@v4.2
```
### Pull Request events
```yaml
name: CI
on:
pull_request:
branches:
- main
@ -85,9 +64,18 @@ jobs:
name: Test changed-files
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # OR "2" -> To retrieve the preceding commit.
- name: Get changed files
id: changed_files
uses: tj-actions/changed-files@v4.2
- name: List all modified files
run: |
for file in "${{ steps.changed_files.outputs.all_modified_files }}"; do
echo "$file was modified"
done
```
@ -110,7 +98,7 @@ jobs:
- name: List all added files
run: |
for file in "${{ steps.changed_files.outputs.added_files }}"; do
echo $file
echo "$file was added"
done
- name: Run step when a file changes in a PR relative to the default branch