Pass values between jobs through `needs`.
Section: Env files, step outputs, and job outputs
Promote a step output to a job output
yaml
yaml
jobs:
prepare:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.meta.outputs.version }}
steps:
- id: meta
run: echo "version=1.2.3" >> "$GITHUB_OUTPUT"
deploy:
needs: prepare
runs-on: ubuntu-latest
steps:
- run: echo "Deploying ${{ needs.prepare.outputs.version }}"Explanation
Job outputs are the standard way to pass structured values between jobs.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Env files, step outputs, and job outputs
Set an environment variable for later steps
Append to `GITHUB_ENV` to persist a variable in the current job.
Read a previous step output
Use the `steps` context to consume a step output.
Write a multiline value to GITHUB_OUTPUT
Preserve newlines in an output variable.