---
source: https://iinventedlight.com/library/notes/github-actions-job-outputs.md
title: "A job exposes outputs that later jobs read through the needs context"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "CC-BY-4.0 (GitHub Docs); CC-BY-4.0 (github/docs (GitHub)); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: GitHub Docs, Defining and using job outputs, CC-BY-4.0 (https://raw.githubusercontent.com/github/docs/main/LICENSE). Copyright GitHub, Inc.; github/docs (GitHub), Setting an output parameter (workflow commands), CC-BY-4.0 (https://raw.githubusercontent.com/github/docs/main/LICENSE). Copyright GitHub, Inc.."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-17
status: published
approved_by: "Cole Withington, 2026-11-20 13:14 PT: \"Publish the full batch and rewrite the 6 live notes\""
checked_on: 2026-11-17
as_of: 2026-11-17
confidence: medium
untested: "Not reproduced (2026-11-17). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-web: GitHub Actions job outputs"
tags: [github-actions, job-outputs, GITHUB_OUTPUT, needs]
client: Librarian
sources:
  - id: S1
    title: "Defining and using job outputs"
    publisher: GitHub Docs
    url: https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/pass-job-outputs
    accessed: 2026-11-17
    license: "CC-BY-4.0"
  - id: S2
    title: "Setting an output parameter (workflow commands)"
    publisher: github/docs (GitHub)
    url: https://github.com/github/docs/blob/main/content/actions/reference/workflows-and-actions/workflow-commands.md
    accessed: 2026-11-17
    license: "CC-BY-4.0"
---
# A job exposes outputs that later jobs read through the needs context
**Answer:** Define job outputs with the `jobs.<job_id>.outputs` syntax, mapping each name to a step output. Use the `jobs.<job_id>.needs` syntax to make this job dependent on the original job. Access the outputs in the dependent job with the `needs.<job_id>.outputs.<output_name>` syntax.

## Writing a step output

A step writes an output by appending `name=value` to the `GITHUB_OUTPUT` environment file: `echo "{name}={value}" >> "$GITHUB_OUTPUT"`. The step needs an `id` so later steps can retrieve the value as `steps.<id>.outputs.<name>`. The job defines outputs that are mapped to the results of its steps.

## See also

- [github-actions-workflow-basics](https://iinventedlight.com/library/notes/github-actions-workflow-basics/)
- [github-actions-matrix](https://iinventedlight.com/library/notes/github-actions-matrix/)
- [github-actions-service-containers](https://iinventedlight.com/library/notes/github-actions-service-containers/)
- [github-actions-token-permissions](https://iinventedlight.com/library/notes/github-actions-token-permissions/)

## Claims

- id: C1
  claim: Define job outputs with the jobs.<job_id>.outputs syntax.
  source: S1
  evidence: "Use the `jobs.<job_id>.outputs` syntax"

- id: C2
  claim: A dependent job reads outputs as needs.<job_id>.outputs.<output_name>.
  source: S1
  evidence: "needs.<job_id>.outputs.<output_name>"

- id: C3
  claim: Write a step output by appending name=value to GITHUB_OUTPUT.
  source: S2
  evidence: "echo \"{name}={value}\" >> \"$GITHUB_OUTPUT\""

- id: C4
  claim: The step must have an id before later steps can read its output.
  source: S2
  evidence: "the step will need an `id`"

## Sources

- [S1] Defining and using job outputs. GitHub Docs. https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/pass-job-outputs . License: CC-BY-4.0. Accessed 2026-11-17.

- [S2] Setting an output parameter (workflow commands). github/docs (GitHub). https://github.com/github/docs/blob/main/content/actions/reference/workflows-and-actions/workflow-commands.md . License: CC-BY-4.0. Accessed 2026-11-17.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: GitHub Docs, Defining and using job outputs, CC-BY-4.0 (https://raw.githubusercontent.com/github/docs/main/LICENSE). Copyright GitHub, Inc.; github/docs (GitHub), Setting an output parameter (workflow commands), CC-BY-4.0 (https://raw.githubusercontent.com/github/docs/main/LICENSE). Copyright GitHub, Inc.. Text was condensed and changed from the originals.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
