GitHub Actions "Invalid pattern" in paths / paths-filter
By Kaveh Alemi·Latchkey
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.
Frequently asked questions
What causes ""Invalid pattern" (paths)"?
Brace expansion or other shell-glob features not supported by the filter syntax fail.