Skip to content
Latchkey

GitHub Actions "Matrix vector has no values to expand"

A matrix dimension resolved to an empty list, so there is nothing to expand and the job never runs.

What this error means

The matrix job is skipped or rejected because one of its vectors is empty, often after a fromJSON that produced [].

github-actions
The workflow is not valid. .github/workflows/ci.yml (Line: 10): Matrix vector 'version' does not contain any values

Common causes

A dynamic matrix produced an empty array

A matrix built from fromJSON of a job output can be [] when the upstream step emitted nothing.

An empty literal list

Declaring version: [] expands to zero combinations.

How to fix it

Guarantee at least one matrix value

  1. Verify the upstream step emits a non-empty JSON array.
  2. Fall back to a default value when the dynamic list is empty.
.github/workflows/ci.yml
strategy:
  matrix:
    version: ${{ fromJSON(needs.setup.outputs.versions) }}

How to prevent it

  • Log the JSON before feeding it into a matrix.
  • Add a guard job that fails clearly when the list is empty.

Frequently asked questions

What causes ""Matrix ... has no values""?
A matrix built from fromJSON of a job output can be [] when the upstream step emitted nothing.
How do I fix "Matrix ... has no values"?
Guarantee at least one matrix value

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card