mirror of
https://github.com/tj-actions/changed-files
synced 2024-12-17 03:47:20 +00:00
Update README.md
This commit is contained in:
parent
686b672b03
commit
2f20ef2c6b
1 changed files with 10 additions and 30 deletions
40
README.md
40
README.md
|
@ -63,7 +63,7 @@ jobs:
|
|||
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v2.0.1
|
||||
uses: tj-actions/changed-files@v12.2
|
||||
|
||||
- name: List all changed files
|
||||
run: |
|
||||
|
@ -140,11 +140,11 @@ Support this project with a :star:
|
|||
|
||||
- name: Get changed files using defaults
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v2.0.1
|
||||
uses: tj-actions/changed-files@v12.2
|
||||
|
||||
- name: Get changed files using a comma separator
|
||||
id: changed-files-comma
|
||||
uses: tj-actions/changed-files@v2.0.1
|
||||
uses: tj-actions/changed-files@v12.2
|
||||
with:
|
||||
separator: ","
|
||||
|
||||
|
@ -166,7 +166,7 @@ Support this project with a :star:
|
|||
|
||||
- name: Get specific changed files
|
||||
id: changed-files-specific
|
||||
uses: tj-actions/changed-files@v2.0.1
|
||||
uses: tj-actions/changed-files@v12.2
|
||||
with:
|
||||
files: |
|
||||
my-file.txt
|
||||
|
@ -204,14 +204,14 @@ Support this project with a :star:
|
|||
|
||||
- name: Use a source file or list of file(s) to populate to files input.
|
||||
id: changed-files-specific-source-file
|
||||
uses: tj-actions/changed-files@v2.0.1
|
||||
uses: tj-actions/changed-files@v12.2
|
||||
with:
|
||||
files_from_source_file: |
|
||||
test/changed-files-list.txt
|
||||
|
||||
- name: Use a source file or list of file(s) to populate to files input and optionally specify more files.
|
||||
id: changed-files-specific-source-file-and-specify-files
|
||||
uses: tj-actions/changed-files@v2.0.1
|
||||
uses: tj-actions/changed-files@v12.2
|
||||
with:
|
||||
files_from_source_file: |
|
||||
test/changed-files-list.txt
|
||||
|
@ -220,13 +220,13 @@ Support this project with a :star:
|
|||
|
||||
- name: Use a different commit SHA
|
||||
id: changed-files-custom-sha
|
||||
uses: tj-actions/changed-files@v2.0.1
|
||||
uses: tj-actions/changed-files@v12.2
|
||||
with:
|
||||
sha: ${{ github.event.pull_request.head.sha }}
|
||||
|
||||
- name: Use a different base SHA
|
||||
id: changed-files-custom-base-sha
|
||||
uses: tj-actions/changed-files@v2.0.1
|
||||
uses: tj-actions/changed-files@v12.2
|
||||
with:
|
||||
base_sha: "2096ed0"
|
||||
|
||||
|
@ -238,7 +238,7 @@ Support this project with a :star:
|
|||
|
||||
- name: Run changed-files with defaults on the dir1
|
||||
id: changed-files-for-dir1
|
||||
uses: tj-actions/changed-files@v2.0.1
|
||||
uses: tj-actions/changed-files@v12.2
|
||||
with:
|
||||
path: dir1
|
||||
|
||||
|
@ -250,32 +250,12 @@ Support this project with a :star:
|
|||
|
||||
- name: Run changed-files using the last commit on the remote branch
|
||||
id: changed-files-since-last-remote-commit
|
||||
uses: tj-actions/changed-files@v2.0.1
|
||||
uses: tj-actions/changed-files@v12.2
|
||||
with:
|
||||
since_last_remote_commit: "true"
|
||||
|
||||
```
|
||||
|
||||
### Running [pre-commit](https://pre-commit.com/) on all modified files
|
||||
|
||||
```yaml
|
||||
...
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v2.0.1
|
||||
|
||||
- name: Pre-commit
|
||||
uses: pre-commit/action@v2.0.0
|
||||
with:
|
||||
extra_args: -v --hook-stage push --files ${{ steps.changed-files.outputs.all_changed_files }}
|
||||
token: ${{ secrets.github_token }}
|
||||
```
|
||||
|
||||
<img width="1147" alt="Screen Shot 2021-11-19 at 4 59 21 PM" src="https://user-images.githubusercontent.com/17484350/142696936-8b7ca955-7ef9-4d53-9bdf-3e0008e90c3f.png">
|
||||
|
||||
* Free software: [MIT license](LICENSE)
|
||||
|
|
Loading…
Reference in a new issue