GitHub Actions paths / paths-ignore Filter Not Matching as Expected
A workflow runs (or skips) unexpectedly because paths and paths-ignore are an allow/deny pair you cannot combine for the same event, the globs do not match what you think, or you applied them to an event that ignores them.
What this error means
A push that touches only ignored files still triggers a run, or a change you expected to match the paths filter is skipped, because the filter logic or glob did not behave as assumed.
on:
push:
paths: ['src/**']
paths-ignore: ['**.md'] # combining both for one event is ambiguousCommon causes
paths and paths-ignore combined
For a single event you should use one or the other. paths is an allowlist; paths-ignore is a denylist. Mixing them for the same event leads to confusing behavior.
Glob does not match the changes
Path filters use glob patterns. A pattern like src/* does not match nested files; you need src/** for recursive matches.
Filter applied to an unsupported event
paths/paths-ignore only apply to push and pull_request. They have no effect on schedule, workflow_dispatch, or most other events.
How to fix it
Choose one filter and use recursive globs
Pick paths or paths-ignore per event, and use ** for recursive directory matches.
on:
push:
paths:
- 'src/**'
- '!src/docs/**' # negate within paths instead of mixingAccount for filter scope
- Remember required checks may stall if a path filter skips the workflow - pair with a passthrough.
- Do not expect path filters to gate workflow_dispatch or schedule events.
- Test the glob against a representative changed-file set.
How to prevent it
- Use paths or paths-ignore per event, not both.
- Prefer ** for recursive matches and negation within paths.
- Remember filters only apply to push and pull_request.