Skip to content
Latchkey

GitHub Actions matrix context not available in job name in CI

The matrix context is available in a job's name and most step-level fields, but NOT in the workflow-level run-name, which is evaluated before jobs expand. Using matrix there leaves the literal expression or an empty value.

What this error means

A job or run title shows the raw text ${{ matrix.node }} instead of the value, or the matrix reference resolves to empty in run-name.

Actions
run-name: Build ${{ matrix.node }}
# run-name is evaluated before the matrix expands, so matrix is not available here

Common causes

matrix used in workflow-level run-name

run-name is computed at workflow start, before any job or matrix exists, so matrix is not in scope and does not interpolate.

A typo in the context reference

A misspelled vector name (matrix.nde) resolves to empty rather than erroring, so the name looks wrong.

How to fix it

Use matrix in job name, not run-name

  1. Move the matrix reference into the job-level name field.
  2. Reference the exact vector key you declared.
  3. Confirm the expanded job title shows the value.
.github/workflows/ci.yml
jobs:
  build:
    name: build (node ${{ matrix.node }})
    strategy:
      matrix:
        node: [18, 20]

Compose run-name from available contexts

For a dynamic run title, use github or inputs contexts, which are available at workflow start, instead of matrix.

How to prevent it

  • Reserve matrix references for job name and step fields.
  • Use github/inputs contexts in run-name, not matrix.
  • Match vector names exactly to avoid silent empty interpolation.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →