Skip to content
Latchkey

GitHub Actions continue-on-error on a matrix hides a real failing leg

continue-on-error lets a step or job fail without failing the run. Applied to a whole matrix it masks every failing leg, so a broken combination passes CI silently and required checks go green.

What this error means

A matrix leg clearly failed in its logs, yet the job and the overall run are reported as successful.

github-actions
strategy:
  matrix:
    target: [a, b, c]
continue-on-error: true   # every leg can fail without failing the run
# target=b failed but the run is green

Diagnose it: print the context before you change anything

Most workflow-expression bugs are not syntax errors, they are an expression reading something that is empty. GitHub resolves a missing property to an empty string instead of failing the run, so a wrong reference looks like a logic bug rather than a mistake. Dump the contexts first and you will usually see the answer immediately.

.github/workflows/ci.yml
- name: Dump contexts
  run: |
    echo '--- github ---'   ; echo '${{ toJSON(github) }}'
    echo '--- needs ---'    ; echo '${{ toJSON(needs) }}'
    echo '--- steps ---'    ; echo '${{ toJSON(steps) }}'
    echo '--- matrix ---'   ; echo '${{ toJSON(matrix) }}'
    echo '--- inputs ---'   ; echo '${{ toJSON(inputs) }}'

Check the context is allowed where you used it

Contexts are not available everywhere. The same expression can be valid in a step if and invalid in a job if, which is why an expression that works in one workflow fails when moved.

Where you wrote itContexts available there
run-namegithub, inputs, vars
concurrencygithub, inputs, vars
Top-level envgithub, secrets, inputs, vars
jobs.<id>.ifgithub, needs, vars, inputs
jobs.<id>.steps.ifgithub, needs, strategy, matrix, job, runner, env, vars, steps, inputs
jobs.<id>.outputsFull access, including secrets
Reusable workflow outputsgithub, jobs, vars, inputs

Common causes

continue-on-error applied at job level over the matrix

It suppresses the failing status of every matrix leg, not just a known-flaky one.

Intent was to tolerate one leg, not all

Tolerating a single experimental combination requires scoping continue-on-error to that include entry.

How to fix it

Scope continue-on-error to a single include leg

  1. Move continue-on-error into the specific matrix combination you want to tolerate via include.
  2. Leave the rest of the matrix strict so real failures fail the run.
.github/workflows/ci.yml
strategy:
  matrix:
    target: [a, b]
    include:
      - target: experimental
        experimental: true
steps:
  - run: ./build.sh ${{ matrix.target }}
    continue-on-error: ${{ matrix.experimental == true }}

Remove blanket continue-on-error

  1. Delete job-level continue-on-error unless every leg is genuinely allowed to fail.
  2. Use fail-fast: false to keep legs independent without hiding failures.

Catch it before it reaches CI

Every failure in this cluster is statically detectable. actionlint parses workflow expressions, checks context availability against the same rules above, and validates needs references, so these bugs never need to cost you a run.

Terminal
# one-off
docker run --rm -v "$(pwd):/repo" --workdir /repo rhysd/actionlint:latest -color

# as a job, before anything expensive runs
- uses: actions/checkout@v4
- run: |
    bash <(curl -s https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
    ./actionlint -color

How to prevent it

  • Keep continue-on-error as narrow as possible.
  • Audit required checks to ensure they actually go red on real failures.

Frequently asked questions

What causes GitHub Actions continue-on-error on a matrix hides a real failing leg?
There are 2 common causes: continue-on-error applied at job level over the matrix and intent was to tolerate one leg, not all. It suppresses the failing status of every matrix leg, not just a known-flaky one.
How do I fix GitHub Actions continue-on-error on a matrix hides a real failing leg?
There are 2 fixes depending on which cause you have: scope continue-on-error to a single include leg and remove blanket continue-on-error. Work through them in order, since the first is the most common.
What does GitHub Actions continue-on-error on a matrix hides a real failing leg actually mean?
A matrix leg clearly failed in its logs, yet the job and the overall run are reported as successful.
How do I stop GitHub Actions continue-on-error on a matrix hides a real failing leg happening again?
Keep continue-on-error as narrow as possible. The prevention section lists 2 changes that keep it from recurring.

Related guides

References

Not every red build is your code. Latchkey repairs the ones that are not, on the runner. Start free → 30-day trial · No credit card