GitHub Actions job outputs map is empty because the producing step failed
A job output is bound to steps.<id>.outputs.<name>. If that step fails before writing to GITHUB_OUTPUT, the value is never set and the job output is empty even when the job ultimately reports a value mapping.
What this error means
A downstream job reads empty values from needs.<job>.outputs because the producing step errored prior to writing its output.
github-actions
- id: meta
run: |
./compute.sh # exits non-zero here
echo "tag=$TAG" >> "$GITHUB_OUTPUT" # never reached
outputs:
tag: ${{ steps.meta.outputs.tag }} # emptyCommon causes
Step errors before the output write
A non-zero exit earlier in the run block aborts the step before it appends to GITHUB_OUTPUT.
Output written conditionally and the branch was skipped
If the write is inside a conditional that did not run, the output stays unset.
How to fix it
Write the output before risky work or unconditionally
- Compute and write the output early, then run the operations that may fail.
- Ensure the GITHUB_OUTPUT append always executes.
.github/workflows/ci.yml
- id: meta
run: |
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
./compute.shMake the consumer tolerate a missing output
- Guard the downstream job on needs.<job>.result == success.
- Provide a default for the output when the producer failed.
How to prevent it
- Write outputs as early as possible in the step.
- Treat outputs from steps that can fail as optional downstream.
Related guides
GitHub Actions Job Outputs Empty in a Downstream Job (needs.outputs)Fix GitHub Actions job outputs that arrive empty downstream - you must map step outputs to jobs.<id>.outputs…
GitHub Actions needs.<job>.outputs is null because the upstream job was skippedFix a downstream job reading an empty needs output because the producing job was skipped, not run.
GitHub Actions Multiline GITHUB_OUTPUT / GITHUB_ENV "Invalid format"Fix GitHub Actions "Invalid format" writing multiline values to GITHUB_OUTPUT or GITHUB_ENV - multiline conte…