Skip to content
Latchkey

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 }}   # empty

Common 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

  1. Compute and write the output early, then run the operations that may fail.
  2. Ensure the GITHUB_OUTPUT append always executes.
.github/workflows/ci.yml
- id: meta
  run: |
    echo "tag=$TAG" >> "$GITHUB_OUTPUT"
    ./compute.sh

Make the consumer tolerate a missing output

  1. Guard the downstream job on needs.<job>.result == success.
  2. 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

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