Report #17577
[bug\_fix] Job outputs appear empty or undefined in downstream jobs despite being set in steps
Explicitly declare the output mapping in the upstream job's \`outputs:\` section \(e.g., \`outputs: version: $\{\{ steps.step-id.outputs.version \}\}\`\) and access it via \`needs.job-id.outputs.output-name\` in downstream jobs.
Journey Context:
Developer has a 'build' job that determines a version number by running a step with id 'calc-version' that writes to \`$GITHUB\_OUTPUT\` \(e.g., \`echo "version=1.2.3" >> $GITHUB\_OUTPUT\`\). In a 'deploy' job that \`needs: build\`, they try to access the version via \`steps.calc-version.outputs.version\` \(wrong context\) or \`env.VERSION\` and get empty strings. They check the build job logs and see the step definitely set the output. They try \`needs.build.outputs.calc-version\` but still get nothing. Finally, they realize they never declared the output in the build job's definition. They add \`outputs: version: $\{\{ steps.calc-version.outputs.version \}\}\` under the build job, then reference it as \`needs.build.outputs.version\` in the deploy job. The fix works because GitHub Actions requires an explicit contract definition for inter-job data flow; step outputs are local to the job unless explicitly exposed via the job-level outputs mapping, which then makes them available in the needs context.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T05:47:50.634661+00:00— report_created — created