mirror of
https://github.com/dorny/paths-filter.git
synced 2025-06-07 16:49:03 +00:00
Extend filter syntax with optional specification of file status: add, modified, deleted (#22)
* Add support for specification of change type (add,modified,delete) * Use NULL as separator in git-diff command output * Improve PR test workflow * Fix the workflow file
This commit is contained in:
parent
caef9bef1f
commit
1ff702da35
11 changed files with 397 additions and 90 deletions
26
.github/workflows/pull-request-verification.yml
vendored
26
.github/workflows/pull-request-verification.yml
vendored
|
@ -70,3 +70,29 @@ jobs:
|
|||
- name: filter-test
|
||||
if: steps.filter.outputs.any != 'true' || steps.filter.outputs.error == 'true'
|
||||
run: exit 1
|
||||
|
||||
test-change-type:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: touch add.txt && rm README.md && echo "TEST" > LICENSE && git add -A
|
||||
- uses: ./
|
||||
id: filter
|
||||
with:
|
||||
token: ''
|
||||
filters: |
|
||||
add:
|
||||
- added: "add.txt"
|
||||
rm:
|
||||
- deleted: "README.md"
|
||||
modified:
|
||||
- modified: "LICENSE"
|
||||
any:
|
||||
- added|deleted|modified: "*"
|
||||
- name: filter-test
|
||||
if: |
|
||||
steps.filter.outputs.add != 'true'
|
||||
|| steps.filter.outputs.rm != 'true'
|
||||
|| steps.filter.outputs.modified != 'true'
|
||||
|| steps.filter.outputs.any != 'true'
|
||||
run: exit 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue