GitHub Actions paths and paths-ignore both set on the same trigger conflict
You can use paths or paths-ignore on an event, but not both. When both are present GitHub uses one and ignores the other, producing surprising trigger behavior that looks like the filter is broken.
What this error means
A workflow triggers (or never triggers) on file changes inconsistently when both paths and paths-ignore are set on the same event.
github-actions
on:
push:
paths: ['src/**']
paths-ignore: ['docs/**'] # combining both is not supportedCommon causes
paths and paths-ignore are mutually exclusive
Only one path filter applies per event; setting both yields undefined intent.
Trying to express include and exclude together
Include-and-exclude must be expressed with a single filter using negation patterns.
How to fix it
Use a single paths filter with negation
- Pick paths and add negated globs to exclude subpaths within it.
- Drop paths-ignore from the same event.
.github/workflows/ci.yml
on:
push:
paths:
- 'src/**'
- '!src/**/*.md'Use paths-ignore alone for exclude-only intent
- If you only want to skip certain paths, use paths-ignore by itself.
- Remove the conflicting paths key.
How to prevent it
- Choose either paths or paths-ignore per event, never both.
- Express include-plus-exclude via negated globs in a single paths list.
Related guides
GitHub Actions paths / paths-ignore Filter Not Matching as ExpectedFix GitHub Actions paths and paths-ignore confusion - they are mutually exclusive per event, use glob rules,…
GitHub Actions workflow run skipped due to a path filterFix GitHub Actions runs that unexpectedly do not trigger because the on.push/pull_request paths filter exclud…
GitHub Actions "Invalid pattern" in a paths / branches FilterFix GitHub Actions "Invalid pattern `x`" - a malformed glob in a paths, paths-ignore, branches, or tags filte…