GitHub Actions matrix exclude removed all combinations and the job never runs
exclude prunes combinations from the Cartesian product. If the exclude filters are too broad or partially match, they can remove every combination, and the matrix job silently produces zero jobs.
What this error means
A matrix job shows no legs at all; the job appears to be skipped because every combination was excluded.
github-actions
strategy:
matrix:
os: [ubuntu-latest]
node: [18, 20]
exclude:
- os: ubuntu-latest
# excludes every os=ubuntu-latest combination -> matrix is emptyCommon causes
Partial-key exclude matches too much
An exclude entry matches any combination containing those keys, so a single-key exclude can wipe out an entire axis.
Excludes overlap the whole product
Several exclude entries together can cover every generated combination.
How to fix it
Make exclude entries fully specify the combination
- List every matrix key in each exclude entry so it removes exactly one combination.
- Re-count remaining combinations after each exclude.
.github/workflows/ci.yml
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
node: [18, 20]
exclude:
- os: windows-latest
node: 18Prefer include to build an explicit allowlist
- When most combinations are invalid, define only the valid ones with include.
- This avoids accidentally pruning everything via exclude.
How to prevent it
- After adding exclude, confirm at least one combination survives.
- Use include for sparse matrices instead of heavy exclude lists.
Related guides
GitHub Actions Matrix include/exclude Produces Wrong CombinationsFix GitHub Actions matrix include/exclude surprises - include adding extra jobs, expanding existing combinati…
GitHub Actions "nested matrix not supported" when defining a matrix inside a matrixFix the validation error from trying to declare a matrix within another matrix value, which GitHub Actions do…
GitHub Actions "matrix must define at least one vector"Fix GitHub Actions "matrix must define at least one vector" - a strategy.matrix was declared with no dimensio…