Skip to content
Latchkey

GitHub Actions matrix continue-on-error per leg not behaving as expected in CI

To let only certain matrix legs fail without failing the whole run, drive continue-on-error from the matrix context, for example an experimental include flag. A blanket continue-on-error: true masks failures on every leg, not just the ones you meant.

What this error means

Either every matrix leg is allowed to fail (masking real breakage), or the experimental leg you wanted to tolerate still fails the run because continue-on-error was not wired to the matrix.

Actions
strategy:
  matrix:
    node: [18, 20]
    include:
      - node: 21
        experimental: true
# without continue-on-error tied to matrix.experimental, node 21 failing fails the run

Common causes

continue-on-error applied to all legs

Setting continue-on-error: true at job level tolerates failures across the entire matrix, hiding genuine regressions.

The tolerated leg is not flagged

Without a matrix flag (like experimental) to key on, there is no way to allow only one combination to fail.

How to fix it

Drive continue-on-error from a matrix flag

  1. Add an experimental field via include to the legs you want to tolerate.
  2. Set continue-on-error from that flag.
  3. Legs without the flag still fail the run on error.
.github/workflows/ci.yml
jobs:
  test:
    continue-on-error: ${{ matrix.experimental == true }}
    strategy:
      matrix:
        node: [18, 20]
        include:
          - node: 21
            experimental: true

Keep non-experimental legs strict

Ensure the default (no flag) evaluates to false so real failures on supported combinations still fail the build.

How to prevent it

  • Tie continue-on-error to a matrix flag, not the whole job.
  • Flag only the legs that are genuinely allowed to fail.
  • Keep supported combinations strict so regressions surface.

Frequently asked questions

What causes "continue-on-error per matrix leg"?
Setting continue-on-error: true at job level tolerates failures across the entire matrix, hiding genuine regressions.
How do I fix continue-on-error per matrix leg?
Drive continue-on-error from a matrix flag

Related guides

References

Run this faster and cheaper on Latchkey managed runners - self-healing included. Start free → 30-day trial · No credit card