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:
parent
5b2a45c658
commit
5f050e0b7a
1 changed files with 39 additions and 39 deletions
78
README.md
78
README.md
|
@ -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.
|
- 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
|
## Outputs
|
||||||
|
|
||||||
Using the default separator.
|
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 |
|
| 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
|
## Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
|
|
Loading…
Reference in a new issue