mirror of
https://github.com/dorny/paths-filter.git
synced 2025-06-07 16:49:03 +00:00
Export files matching rules (#32)
* Export files matching rules * Improve debug output * Fix PR test workflow * Always quote output path + fix PR test * Use proper single quote escaping in workflow file * Improve error handling and docs for list-files input parameter
This commit is contained in:
parent
483986d0a7
commit
3f845744aa
8 changed files with 205 additions and 125 deletions
26
.github/workflows/pull-request-verification.yml
vendored
26
.github/workflows/pull-request-verification.yml
vendored
|
@ -80,24 +80,32 @@ jobs:
|
|||
id: filter
|
||||
with:
|
||||
token: ''
|
||||
list-files: shell
|
||||
filters: |
|
||||
add:
|
||||
added:
|
||||
- added: "add.txt"
|
||||
rm:
|
||||
deleted:
|
||||
- deleted: "README.md"
|
||||
modified:
|
||||
- modified: "LICENSE"
|
||||
any:
|
||||
- added|deleted|modified: "*"
|
||||
- name: Print changed files
|
||||
run: echo '${{steps.filter.outputs.files}}' | jq .
|
||||
- name: Print 'added_files'
|
||||
run: echo ${{steps.filter.outputs.added_files}}
|
||||
- name: Print 'modified_files'
|
||||
run: echo ${{steps.filter.outputs.modified_files}}
|
||||
- name: Print 'deleted_files'
|
||||
run: echo ${{steps.filter.outputs.deleted_files}}
|
||||
- name: filter-test
|
||||
# only single quotes are supported in GH action literal
|
||||
# single quote needs to be escaped with single quote
|
||||
# '''add.txt''' resolves to string 'add.txt'
|
||||
if: |
|
||||
steps.filter.outputs.add != 'true'
|
||||
|| steps.filter.outputs.rm != 'true'
|
||||
steps.filter.outputs.added != 'true'
|
||||
|| steps.filter.outputs.deleted != 'true'
|
||||
|| steps.filter.outputs.modified != 'true'
|
||||
|| steps.filter.outputs.any != 'true'
|
||||
|| !contains(fromJSON(steps.filter.outputs.files).added,'add.txt')
|
||||
|| !contains(fromJSON(steps.filter.outputs.files).modified,'LICENSE')
|
||||
|| !contains(fromJSON(steps.filter.outputs.files).deleted,'README.md')
|
||||
|| steps.filter.outputs.added_files != '''add.txt'''
|
||||
|| steps.filter.outputs.modified_files != '''LICENSE'''
|
||||
|| steps.filter.outputs.deleted_files != '''README.md'''
|
||||
run: exit 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue