GitHub Actions step id containing a dash cannot be referenced in steps context
A step id is used as a property key in the steps context, e.g. steps.build.outputs.x. Ids with dashes still work via bracket access, but dot access (steps.my-step.outputs) parses my and -step separately and resolves to nothing.
What this error means
steps.<id>.outputs.<name> is empty when the step id contains a dash and is accessed with dot syntax.
github-actions
- id: my-step
run: echo "v=1" >> "$GITHUB_OUTPUT"
- run: echo "${{ steps.my-step.outputs.v }}" # dot access mis-parses the dashCommon causes
Dash breaks dot property access
Dot access treats the dash as an operator, so steps.my-step does not resolve to the step.
Id mismatch between definition and reference
A reference that does not exactly match the id resolves to an empty object.
How to fix it
Use an id without dashes
- Prefer underscores in step ids so dot access works cleanly.
- Update all references to the new id.
.github/workflows/ci.yml
- id: my_step
run: echo "v=1" >> "$GITHUB_OUTPUT"
- run: echo "${{ steps.my_step.outputs.v }}"Reference a dashed id with bracket syntax
- If you must keep the dash, use bracket access on the steps context.
- Quote the id inside the brackets.
.github/workflows/ci.yml
- run: echo "${{ steps['my-step'].outputs.v }}"How to prevent it
- Use underscores, not dashes, in step ids.
- Keep id definitions and references identical.
Related guides
GitHub Actions Duplicate Step id - Outputs Read the Wrong StepFix GitHub Actions step id collisions - reusing the same id on two steps makes steps.<id>.outputs resolve to…
GitHub Actions steps.<id>.outputs Empty - Missing or Wrong Step idFix GitHub Actions steps.<id>.outputs coming back empty - a step with no id, a typo in the id, or reading the…
GitHub Actions job outputs map is empty because the producing step failedFix empty job outputs caused by the step that writes them failing before it reaches the GITHUB_OUTPUT write.