Adds ignore path functionality

This commit is contained in:
Henry Painter 2022-08-13 15:47:59 +01:00
parent b0bc141e31
commit d748e34e85
10 changed files with 9748 additions and 32251 deletions

18
.github/filters.yml vendored
View file

@ -1,4 +1,20 @@
error:
- not_existing_path/**/*
any:
- "**/*"
- "**/*"
anyignore:
-
paths: "**/*"
paths_ignore:
- "**/*.md"
anyignorenull:
-
paths: "**/*"
paths_ignore:
- "**local.ts"
- "**local.md"
anyignoreall:
-
paths: "**/*"
paths_ignore:
- "**/*.no"

View file

@ -11,7 +11,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- run: |
npm install
npm ci
npm run all
self-test:

View file

@ -213,4 +213,37 @@ jobs:
run: exit 1
- name: changes-test
if: contains(fromJSON(steps.filter.outputs.changes), 'error') || !contains(fromJSON(steps.filter.outputs.changes), 'any')
run: exit 1
run: exit 1
- name: print context
run: |
echo "${{ tojson(steps.filter) }}"
test-ignore-changes:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: |
echo "NEW FILE" > local.ts
echo "IGNORE FILE" > local.md
- run: git add local.ts local.md
- uses: ./
id: filter
with:
base: HEAD
filters: '.github/filters.yml'
- name: print context
run: |
echo "${{ tojson(steps.filter) }}"
- name: filter-test
if: steps.filter.outputs.any != 'true'
run: exit 1
- name: ignore-test
if: steps.filter.outputs.anyignore_count != 1
run: exit 1
- name: ignore_testnull
if: steps.filter.outputs.anyignorenull == true
run: exit 1
- name: ignore_testall
if: steps.filter.outputs.anyignoreall_count != 2
run: |
exit 1