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:
Michal Dorner 2020-07-11 17:17:56 +02:00
parent caef9bef1f
commit 1ff702da35
No known key found for this signature in database
GPG key ID: 9EEE04B48DA36786
11 changed files with 397 additions and 90 deletions

View file

@ -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