Skip to content

ci: fix docs-only detection by inverting to has-code filter#3559

Merged
zackverham merged 1 commit intomainfrom
fix/paths-filter-predicate-quantifier
Feb 19, 2026
Merged

ci: fix docs-only detection by inverting to has-code filter#3559
zackverham merged 1 commit intomainfrom
fix/paths-filter-predicate-quantifier

Conversation

@zackverham
Copy link
Collaborator

@zackverham zackverham commented Feb 19, 2026

Summary

Fixes docs-only detection which was completely broken due to issues with dorny/paths-filter's predicate-quantifier feature.

Problems Found

  1. Missing input definition: The predicate-quantifier input isn't declared in action.yml for v3, causing "Unexpected input" warnings

  2. Broken implementation: Even when the input is accepted, the implementation is wrong:

    • Expected: "Return true if ALL changed files match at least one pattern"
    • Actual: "A file matches only if it matches ALL patterns" (L110-111: patterns.every(aPredicate) checks if a single file matches every pattern)

    This meant CHANGELOG.md was rejected because it doesn't match LICENSE, .gitignore, etc.

Solution

Invert the logic from detecting "docs-only" to detecting "has-code":

# Old (broken): docs-only is true if ALL files are docs
docs-only:
  - '**/*.md'
  - 'LICENSE'
  # predicate-quantifier: every  # broken!

# New (works): has-code is true if ANY file is NOT a doc
code:
  - '**'
  - '!**/*.md'
  - '!LICENSE'
  - '!.gitignore'
  - '!.gitattributes'

With the default some quantifier:

  • has-code = true if any file matches (i.e., any non-doc file exists)
  • CI runs when has-code == 'true'
  • CI skips when only doc files changed

Test plan

  • PRs with only .md file changes skip tests
  • PRs with code changes run tests
  • No more "Unexpected input" warnings

🤖 Generated with Claude Code

@zackverham zackverham requested a review from a team as a code owner February 19, 2026 19:38
The predicate-quantifier feature in dorny/paths-filter is broken:
- The action.yml input definition is missing from v3
- Even when fixed, the implementation is wrong: it checks if each FILE
  matches ALL patterns, not if ALL files match at least one pattern

This meant CHANGELOG.md was rejected because it doesn't match LICENSE,
.gitignore, etc. - completely defeating the purpose.

Fix by inverting the logic:
- Instead of "docs-only = all files are docs" (broken)
- Use "has-code = any file is NOT a doc" (works with default 'some')

This correctly skips CI for docs-only PRs while running it for any PR
that touches code.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@zackverham zackverham force-pushed the fix/paths-filter-predicate-quantifier branch from 0b82c9c to 1a8f150 Compare February 19, 2026 19:47
@zackverham zackverham changed the title ci: pin paths-filter to commit with predicate-quantifier fix ci: fix docs-only detection by inverting to has-code filter Feb 19, 2026
@zackverham zackverham merged commit a348df6 into main Feb 19, 2026
24 checks passed
@zackverham zackverham deleted the fix/paths-filter-predicate-quantifier branch February 19, 2026 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants