Added support for detecting deleted files. (#188)
This commit is contained in:
17
README.md
17
README.md
@@ -83,6 +83,8 @@ jobs:
|
||||
|:--------------------:|:------------:|:----------------------------------:|:----------------------------------------:|
|
||||
| any_changed | `string` | `true` OR `false` | Returns `true` when any <br /> of the filenames provided using <br /> the `files` input has changed. <br /> i.e. *using a combination of all added, <br />copied, modified and renamed files (ACMR).* |
|
||||
| only_changed | `string` | `true` OR `false` | Returns `true` when only <br /> files provided using <br /> the `files` input have changed. |
|
||||
| any_deleted | `string` | `true` OR `false` | Returns `true` when any <br /> of the filenames provided using <br /> the `files` input has been deleted. |
|
||||
| only_deleted | `string` | `true` OR `false` | Returns `true` when only <br /> files provided using <br /> the `files` input has been deleted. |
|
||||
| other_changed_files | `string` | `'new.txt path/to/file.png ...'` | Select all other changed files <br/> not listed in the files input <br /> i.e. *a combination of all added, <br /> copied and modified files (ACMR).* |
|
||||
| all_modified_files | `string` | `'new.txt path/to/file.png ...'` | Select all modified files <br /> i.e. *a combination of all added, <br />copied, modified and renamed files (ACMR).* |
|
||||
| all_changed_and_modified_files | `string` | `'new.txt path/to/file.png ...'` | Select all changed <br /> and modified files <br /> i.e. *a combination of (ACMRDTUX).* |
|
||||
@@ -164,6 +166,20 @@ jobs:
|
||||
run: |
|
||||
echo "Only files listed above have changed."
|
||||
|
||||
- name: Run step if any of the listed files above is deleted
|
||||
if: steps.changed-files.outputs.any_deleted == "true"
|
||||
run: |
|
||||
for file in "${{ steps.changed-files.outputs.deleted_files }}"; do
|
||||
echo "$file was deleted"
|
||||
done
|
||||
|
||||
- name: Run step if all listed files above have been deleted
|
||||
if: steps.changed-files.outputs.only_deleted == "true"
|
||||
run: |
|
||||
for file in "${{ steps.changed-files.outputs.deleted_files }}"; do
|
||||
echo "$file was deleted"
|
||||
done
|
||||
|
||||
- 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@v1.1.0
|
||||
@@ -203,7 +219,6 @@ jobs:
|
||||
uses: tj-actions/changed-files@v1.1.0
|
||||
with:
|
||||
path: subfolder
|
||||
|
||||
```
|
||||
|
||||
### Running [pre-commit](https://pre-commit.com/) on all modified files
|
||||
|
||||
Reference in New Issue
Block a user