Job 'package' has a step 'id: meta' that writes 'version=1.4.2' to $GITHUB_OUTPUT. Job 'publish' has 'needs: [package]'. What must 'package' declare so 'publish' can read the version via needs?
Select an answer to reveal the explanation.
Short Explanation and Infographic
Step outputs stay inside the job until you promote them with a job-level outputs map. Downstream jobs then use needs.<job>.outputs.<name>.
Full explanation below image
Full Explanation
Inter-job data must be exported: the producing job defines 'outputs:' at the job level, mapping names to step outputs using the steps context (valid in the outputs mapping). Dependent jobs declare needs and read '${{ needs.package.outputs.version }}'. Step outputs are not automatically visible across jobs. Workflow-level env cannot capture another job's step outputs at parse/plan time this way. permissions control token scopes, not output visibility. For multi-line or large data, prefer artifacts; for small strings, job outputs are the right tool.