← All Tools

GitHub Actions Matrix Expander

Paste a strategy.matrix block and see every job the runner will spawn. include entries either extend an existing combination (by overlaying keys that don't increase the cross-product) or append a brand-new job, exactly the way GitHub's matrix algorithm handles it. exclude filters out combinations whose keys are all matched.

Examples:
Paste the contents of strategy.matrix only (the keys inside, not strategy: or matrix:). Both YAML and JSON work.
base = from the cartesian product  ·  +include = added or extended by include

JSON output

The same job list as raw JSON — handy when piping to jq or comparing against the jobs.<id>.strategy.matrix.include output of the GitHub API.

[]

How matrix expansion works

GitHub builds the matrix in three steps. First, every key whose value is a list contributes to a cartesian product; keys with scalar values are pinned across all combinations. Second, each include entry is tested against the existing jobs — if all keys it shares with the job and the keys it shares with the base matrix already match (and it doesn't introduce a new value for an existing matrix key), it extends that job by overlaying its extra keys. Entries that can't extend any base job become standalone new jobs at the end. Third, every exclude entry removes any base job whose keys all match. A job extended by an include can't be excluded; standalone include jobs can't be excluded either.