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.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →