GitHub Actions matrix fail-fast cancels sibling jobs unexpectedly in CI
A matrix has fail-fast: true by default. The moment one leg fails, GitHub cancels every other in-progress leg in that matrix. That is why sibling jobs show "cancelled" even though they never failed on their own.
What this error means
One matrix leg fails and the rest immediately show "The operation was canceled" or a cancelled status, hiding which other combinations would have passed or failed.
Error: The operation was canceled.
# a sibling matrix leg failed and fail-fast cancelled this in-progress legCommon causes
fail-fast is on by default
Without setting it, strategy.fail-fast is true, so the first failing leg cancels all other running legs in the same matrix.
You want full results across all combinations
For coverage you often want every leg to finish so you can see all failures at once, which the default prevents.
How to fix it
Disable fail-fast to run every leg
- Set
fail-fast: falseunderstrategy. - Let all legs run to completion.
- Read the full matrix of results to see every failure.
strategy:
fail-fast: false
matrix:
node: [18, 20, 22]Keep fail-fast on when speed matters
For fast feedback where any failure fails the build, leaving the default true cancels the rest and saves runner minutes.
How to prevent it
- Set fail-fast: false when you need results from every combination.
- Leave it default (true) when the first failure should stop the matrix.
- Document the choice so cancelled siblings are not mistaken for bugs.