Path filtering improvement (#2059)

* Another attempt at getting path filtering right

* Improve filters
This commit is contained in:
Josh Mock
2023-11-03 11:41:53 -05:00
committed by GitHub
parent ab10e462e7
commit 99bcff02d5

View File

@ -9,29 +9,23 @@ jobs:
name: Detect files changed
runs-on: ubuntu-latest
outputs:
skip: '${{ steps.changes.outputs.skip }}'
src-only: '${{ steps.changes.outputs.src-only }}'
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter/@v2.11.1
id: changes
with:
filters: |
skip:
- '**/*.md'
- '**/*.asciidoc'
- '**/*.txt'
- 'docs/**'
- '.ci/**'
- '.buildkite/**'
- 'scripts/**'
- 'catalog-info.yaml'
src-only:
- '!(**/*.{md,asciidoc,txt}|*.{md,asciidoc,txt}|{docs,.ci,.buildkite,scripts}/**/*|catalog-info.yaml)'
- '.github/workflows/**'
test:
name: Test
runs-on: ${{ matrix.os }}
needs: paths-filter
# only run if files not in `skip` filter were changed
if: needs.paths-filter.outputs.skip != 'true'
# only run if code relevant to unit tests was changed
if: needs.paths-filter.outputs.src-only == 'true'
strategy:
fail-fast: false