Report #71356
[bug\_fix] Job outputs empty or null when accessed via needs.job.outputs.value in dependent jobs
The producing job did not declare the output in its job-level outputs mapping, or the step that produces the output didn't have an id, or the syntax to write to GITHUB\_OUTPUT was malformed. The fix requires three specific parts: 1\) The producing step must have a unique id \(e.g., id: build\_step\), 2\) The step must write to the file specified by $GITHUB\_OUTPUT using the exact format echo "key=value" >> "$GITHUB\_OUTPUT" \(with quotes to handle spaces\), 3\) The job must map this to a job output using outputs: output\_name: $\{\{ steps.step\_id.outputs.key \}\}. Without all three, the needs context will contain empty strings.
Journey Context:
You have a job 'build' that generates a version string and a job 'deploy' that needs it. In the build job, you run echo "VERSION=$\(date \+%s\)" >> $GITHUB\_ENV and try to access it in deploy via needs.build.outputs.VERSION, but it's empty. You check the docs and realize GITHUB\_ENV is for environment variables within a job, not for passing data between jobs. You update the build job to use echo "version=$\(date \+%s\)" >> $GITHUB\_OUTPUT in a step with id: set\_version, and add outputs: version: $\{\{ steps.set\_version.outputs.version \}\} to the build job. In the deploy job, you reference it with needs.build.outputs.version. On the next run, the deploy job successfully receives the version string and uses it in the deployment command.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T02:20:41.145387+00:00— report_created — created