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