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 valuesCommon 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
- Verify the upstream step emits a non-empty JSON array.
- 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
GitHub Actions fromJSON parse errorFix the GitHub Actions fromJSON parse error caused by passing a non-JSON or malformed string into the fromJSO…
GitHub Actions "needs job X but it is not defined"Fix the GitHub Actions error where a job needs another job that is not defined, usually a typo in the job id…
GitHub Actions "Invalid type" for env or with valuesFix the GitHub Actions "Invalid type" error for env or with values caused by passing a list or mapping where…