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.
- 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.
- 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.