Skip to content

Commit d04372a

Browse files
blagininclaude
andcommitted
Fix paths-filter logic to correctly skip CI for docs-only changes
The previous approach using `'**'` with negations didn't work because dorny/paths-filter returns true if ANY file matches ANY positive pattern. The negations only filter the matched files list, not the boolean output. Solution: Invert the logic by defining a 'docs-only' filter with `predicate-quantifier: 'every'`, which returns true only when ALL changed files are documentation. This correctly skips CI jobs when only docs are modified. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 4742ca0 commit d04372a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

.github/workflows/rust.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,19 @@ jobs:
4040
check-files:
4141
runs-on: ubuntu-latest
4242
outputs:
43-
should_skip: ${{ steps.filter.outputs.code == 'false' }}
43+
should_skip: ${{ steps.filter.outputs.docs-only == 'true' }}
4444
steps:
4545
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
4646
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
4747
id: filter
4848
with:
4949
filters: |
50-
code:
51-
- '**'
52-
- '!**.md'
53-
- '!docs/**'
54-
- '!.github/ISSUE_TEMPLATE/**'
55-
- '!.github/pull_request_template.md'
50+
docs-only:
51+
- 'docs/**'
52+
- '**/*.md'
53+
- '.github/ISSUE_TEMPLATE/**'
54+
- '.github/pull_request_template.md'
55+
predicate-quantifier: 'every'
5656

5757
# Check crate compiles and base cargo check passes
5858
linux-build-lib:

0 commit comments

Comments
 (0)