Skip to content
Latchkey

GitHub Actions secret-derived env var cannot be used in run-name

run-name is evaluated before jobs and cannot access env or secrets. A value derived from a secret simply is not available to run-name, so the segment is empty - and embedding a secret in a name would be masked anyway.

What this error means

A run-name that references a secret-backed env var renders blank because neither env nor secrets is available there.

github-actions
run-name: Release ${{ env.RELEASE_TAG }}   # env.RELEASE_TAG came from a secret; not available
# run shows: "Release "

Common causes

secrets and env not in run-name scope

run-name only supports github and inputs; neither secrets nor env is available.

Secrets would be masked in names anyway

Even if available, a secret value rendered in a name is masked to ***.

How to fix it

Pass a non-secret value via inputs

  1. Provide the display value as a workflow_dispatch input.
  2. Reference inputs.* in run-name, keeping secrets out of names entirely.
.github/workflows/release.yml
on:
  workflow_dispatch:
    inputs:
      release_tag: { required: true }
run-name: Release ${{ inputs.release_tag }}

Show the value in a job summary instead

  1. Compute the value in a job and write it to the step summary.
  2. Keep secrets out of names and run-name.

How to prevent it

  • Never put secret-derived values in run-name.
  • Use inputs for run-name dynamics and summaries for runtime values.

Frequently asked questions

What causes "secret env in run-name"?
run-name only supports github and inputs; neither secrets nor env is available.
How do I fix secret env in run-name?
Pass a non-secret value via inputs

Related guides

References

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