How to Control fail-fast in a GitHub Actions Matrix
fail-fast is true by default, so one failing leg cancels its siblings; set it false to see every result.
Set strategy.fail-fast: false to let all legs finish even after one fails, or keep the default true to cancel siblings early and save minutes.
Steps
- Add
fail-fast:understrategy. - Use
true(default) for fast PR feedback that stops at the first break. - Use
falsewhen you need the full pass/fail picture across all legs.
Workflow
.github/workflows/ci.yml
jobs:
test:
strategy:
fail-fast: false
matrix:
node: [18, 20, 22]
runs-on: ubuntu-latest
steps:
- run: npm ci && npm testGotchas
- With fail-fast on, a single failure cancels in-flight siblings, so you lose their results.
- fail-fast and continue-on-error are independent controls; you can combine them per leg.
Related guides
How to Limit Concurrent Matrix Jobs With max-parallel in GitHub ActionsCap how many GitHub Actions matrix legs run at once with strategy.max-parallel, throttling a wide fan-out to…
How to Allow Specific Matrix Legs to Fail in GitHub ActionsMark experimental GitHub Actions matrix legs as non-blocking by driving continue-on-error from a matrix flag…