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
needs:
Declares job dependencies so the current job waits for the listed jobs to complete successfully. Also exposes their outputs via `needs.<job_id>.outputs.<name>` and their result via `needs.<job_id>.result`.
run:
Executes a shell command on the runner. Multi-line scripts run in a single shell invocation; the shell is chosen by `shell:` (or workflow `defaults`) and defaults to bash on Linux/macOS and pwsh on Windows.
contains / startsWith / format / join / fromJSON
Built-in functions available inside `${{ }}` expressions. GitHub Actions does not allow user-defined functions — only the documented list is valid.
jobs:
Top-level map of jobs that run in parallel by default. Each job has an ID (used by `needs:` and outputs) and either a `steps:` list or a `uses:` reference to a reusable workflow.
runs-on:
Selects the runner (or runner group) that will execute the job. Accepts a single label, an array to match multiple labels (self-hosted), or an object form for larger runners and runner groups.