How do `jobs.<id>.outputs` work?
BeginnerConceptJobs, Steps, Matrix & Concurrency
Answer
A job declares outputs mapped from step outputs; downstream jobs read them through needs.
build:
outputs:
digest: ${{ steps.push.outputs.digest }}
steps:
- id: push
run: echo "digest=sha256:abc..." >> "$GITHUB_OUTPUT"
deploy:
needs: build
steps:
- run: echo "Deploying ${{ needs.build.outputs.digest }}"
Outputs are strings, up to 1 MB per job and 50 MB per run in total. Values that contain a secret are dropped with a warning.
More on Jobs, Steps, Matrix & Concurrency
How does `needs` work, and what happens to a job whose dependency failed or was skipped?BeginnerWhat is the implicit `success()` in a job `if`, and why is `always()` usually the wrong fix?IntermediateWhat values can `needs.<job>.result` take?BeginnerHow does a matrix expand, and how are job names generated?BeginnerHow do `include` and `exclude` work in a matrix?IntermediateWhat do `fail-fast` and `max-parallel` do?Beginner