Skip to content
Latchkey

GitHub Actions concurrency Group Expression Evaluated Too Early

A concurrency.group expression references a context that is not available where concurrency is evaluated, or resolves to an empty string, so the workflow fails to compile or groups unrelated runs into one bucket.

What this error means

The workflow is rejected with an unrecognized named-value in the concurrency block, or unrelated runs cancel each other because the group key evaluated to the same empty value.

.github/workflows/ci.yml
concurrency:
  group: deploy-${{ steps.meta.outputs.env }}   # steps not available at workflow level
  cancel-in-progress: true

Common causes

Context not available at the concurrency level

Workflow-level concurrency is evaluated early. The steps, job, and matrix contexts do not exist there; only github, inputs, vars, and similar are available.

Group key resolves to empty

If the expression yields an empty string, every run shares the same empty group and contends, cancelling each other unexpectedly.

How to fix it

Use a context available at that level

.github/workflows/ci.yml
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

Move dynamic grouping to job level

  1. Job-level concurrency can use the matrix context for per-combination groups.
  2. For workflow-level grouping, stick to github, inputs, and vars contexts.
  3. Ensure the group expression never collapses to an empty string.

How to prevent it

  • Key concurrency on github.workflow plus github.ref by default.
  • Use only contexts available at the level where concurrency is declared.
  • Verify the group key is always non-empty and meaningfully unique.

Related guides

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