Passing a Value Between Jobs
Job build computes an image tag in a step with id: meta. Job deploy (with needs: build) must use it. What's the correct wiring?
build
id: meta
deploy
needs: build
Choose one answer
Export it with echo "TAG=..." >> "$GITHUB_ENV" in build; deploy reads $TAG.
echo "TAG=..." >> "$GITHUB_ENV"
$TAG
Set it as a repository variable in build and read it with vars.TAG in deploy.
vars.TAG
Write it to $GITHUB_OUTPUT, map it in build's outputs:, read needs.build.outputs.tag.
$GITHUB_OUTPUT
outputs:
needs.build.outputs.tag
Read it in deploy with steps.meta.outputs.tag, since step IDs are global.
steps.meta.outputs.tag