jobs

outputs:

Declares values a job exposes to downstream jobs that `needs:` it. Values are usually pulled from step outputs written to `$GITHUB_OUTPUT`.

outputs:
  <name>: ${{ steps.<step_id>.outputs.<key> }}

Common values / subkeys

Value / Subkey Purpose
<output_name> Key downstream jobs read as needs.<job>.outputs.<name>
value expression Any expression — typically steps.<id>.outputs.<key>
$GITHUB_OUTPUT File a step appends `key=value` to in order to set a step output
steps.<id>.outputs.<key> Reference within the same job

Examples

jobs:
  build:
    runs-on: ubuntu-latest
    outputs:
      tag: ${{ steps.meta.outputs.tag }}
    steps:
      - id: meta
        run: echo "tag=v$(date +%s)" >> "$GITHUB_OUTPUT"

Publish `tag` from a step output

jobs:
  deploy:
    needs: build
    steps:
      - run: echo "deploying ${{ needs.build.outputs.tag }}"

Consume the upstream output

- id: matrix
  run: echo 'list=["a","b"]' >> "$GITHUB_OUTPUT"
outputs:
  list: ${{ steps.matrix.outputs.list }}

Emit JSON for a downstream dynamic matrix

Gotcha

Outputs are strings — a matrix job writes its output once per leg and only one leg's value survives; use `fromJSON()` on the consumer side to re-parse structured data.

Related keywords

← All GitHub Actions syntax · Git commands · Cron syntax