CICD-029 · Emit a producer step output
Encyclopedia · Variables, outputs and data flow · All snippets
Previous · CICD-028 · Next · CICD-030
1. Where it fits
- Placement In a shell step with a declared
id. - Prerequisites GitHub Actions job or equivalent Gitea version with environment file support.
- Platforms local-linux, github-actions, gitea-actions.
- Parameters
GITHUB_OUTPUT,GITHUB_SHA.
2. Copy the snippet
bash
printf 'image_tag=sha-%s\n' "$GITHUB_SHA" >> "$GITHUB_OUTPUT"3. How it works
The shell writes one key=value record to GITHUB_OUTPUT. Later steps access it through the producer step ID and the image_tag output key.
4. Verify the result
Set an ID on the producer and read steps.ID.outputs.image_tag.
Validation syntax-validated (Bash parse). Status definitions.