GitHub Actions "Invalid pattern" in paths / paths-filter
The paths and paths-ignore filters use a restricted glob syntax. Unsupported tokens, a leading negation in the wrong place, or invalid characters cause an Invalid pattern error.
What this error means
The workflow fails to evaluate its path filter, reporting an invalid pattern after a problematic glob in paths or paths-ignore.
github-actions
Invalid workflow file: .github/workflows/ci.yml
Invalid pattern '**.{js,ts}': the pattern is not valid.Common causes
Unsupported glob construct
Brace expansion or other shell-glob features not supported by the filter syntax fail.
Misplaced negation
A ! negation used incorrectly within the pattern set is rejected.
How to fix it
Use supported glob syntax
- Replace brace expansion with separate entries (one per extension).
- Use ** for recursive matches and * for single segments.
- List negations as separate paths-ignore entries where appropriate.
.github/workflows/ci.yml
on:
push:
paths:
- '**/*.js'
- '**/*.ts'How to prevent it
- Stick to the documented paths glob subset; avoid shell-only constructs.
- Test path filters on a branch with representative file changes.
Related guides
GitHub Actions schedule cron not triggering (default branch only)Fix a GitHub Actions schedule trigger that never fires - scheduled workflows run only from the file on the de…
GitHub Actions "A mapping was found where a sequence is expected"Fix "A mapping was found where a sequence is expected" - a list-typed key like steps or jobs.<id>.needs was w…
GitHub Actions "Workflow does not exist" (workflow_dispatch on non-default branch)Fix "Workflow does not exist" when dispatching - workflow_dispatch is only available once the workflow file e…