Interview Prep/GitHub Actions/Expressions, Outputs, Matrix & Conditions

A downstream job reads `needs.build.outputs.digest` and gets an empty string.

IntermediateTroubleshootingExpressions, Outputs, Matrix & Conditions
Answer

Likely causes → The job did not declare outputs: mapping, the step lacks an id, the step wrote to $GITHUB_OUTPUT with wrong format (spaces around =), the output name differs, or the output was dropped because it contained a secret.

Diagnose →

gh run view <id> --log | grep -i "skip output"
yq '.jobs.build.outputs' .github/workflows/cd.yml

Fix → Map outputs: digest: ${{ steps.push.outputs.digest }}, give the step id: push, write echo "digest=$D" >> "$GITHUB_OUTPUT".

Prevent → Print outputs to $GITHUB_STEP_SUMMARY in the producing job during development.

All GitHub Actions questions Roadmap: GitHub Actions

More on Expressions, Outputs, Matrix & Conditions