3
0
Fork 0
mirror of https://github.com/tj-actions/changed-files synced 2025-01-17 19:17:45 +00:00

Update README.md

This commit is contained in:
Tonye Jack 2021-05-04 13:53:26 -04:00 committed by GitHub
parent 5b2a45c658
commit 5f050e0b7a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -16,6 +16,45 @@ Get all modified files relative to the default branch (`pull_request*` events) o
- Regex pattern matching on a subset of files.
## Usage
> NOTE: :warning:
> * For `push` events to work you need to include `fetch-depth: 0` **OR** `fetch-depth: 2` depending on your use case.
```yaml
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
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@v5.1
- name: List all modified files
run: |
for file in "${{ steps.changed-files.outputs.all_modified_files }}"; do
echo "$file was modified"
done
```
## Outputs
Using the default separator.
@ -56,45 +95,6 @@ Using the default separator.
| files | `string OR string[]` | `false` | | Restricted list of specific files to watch for changes |
## Usage
> NOTE: :warning:
> * For `push` events to work you need to include `fetch-depth: 0` **OR** `fetch-depth: 2` depending on your use case.
```yaml
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
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@v5.1
- name: List all modified files
run: |
for file in "${{ steps.changed-files.outputs.all_modified_files }}"; do
echo "$file was modified"
done
```
## Example
```yaml