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.
OpenIn sheetbashsame section
Set a step output
Append to `GITHUB_OUTPUT` to expose a named output.
OpenIn sheetbashsame section
Read a previous step output
Use the `steps` context to consume a step output.
OpenIn sheetyamlsame section
Write a multiline value to GITHUB_OUTPUT
Preserve newlines in an output variable.
OpenIn sheetbashsame section
Build a matrix from JSON
Convert JSON text into a matrix object.
OpenIn sheetyaml1 tag match
Use a context value in a step
Read metadata from the current workflow run.