diff --git a/.github/sharedPathFilter.yml b/.github/sharedPathFilter.yml new file mode 100644 index 0000000..164b88f --- /dev/null +++ b/.github/sharedPathFilter.yml @@ -0,0 +1,4 @@ +sourceCode: + - '**' + - '!*' + - '!.github/workflows/**' \ No newline at end of file diff --git a/.github/workflows/paths-filtering-tests.yml b/.github/workflows/paths-filtering-tests.yml index 74d56fd..fc45296 100644 --- a/.github/workflows/paths-filtering-tests.yml +++ b/.github/workflows/paths-filtering-tests.yml @@ -11,24 +11,22 @@ jobs: permissions: pull-requests: read steps: - # For pull requests it's not necessary to checkout the code + - uses: actions/checkout@v5 - uses: dorny/paths-filter@v3 - id: filter + id: shared + with: + filters: .github/sharedPathFilter.yml + predicate-quantifier: 'every' + - uses: dorny/paths-filter@v3 + id: me with: filters: | - sourceCode: - # Everything - - '**' - # Except stuff at the root of the repo - - '!*' - # Exclude changes to workflows in general - - '!.github/workflows/**' self: # Include changes to THIS workflow - '.github/workflows/paths-filtering-tests.yml' predicate-quantifier: 'every' outputs: - inScope: ${{ steps.filter.outputs.sourceCode == 'true' || steps.filter.outputs.self == 'true' }} + inScope: ${{ steps.shared.outputs.sourceCode == 'true' || steps.me.outputs.self == 'true' }} # A required status check for when 'inScope' files are changed in-scope: