Pass values from one step to the next
A step can publish outputs that later steps in the same job can read. Outputs go to $GITHUB_OUTPUT; later steps reference them via steps.<id>.outputs.<name>.
How to write
Write key=value lines to $GITHUB_OUTPUT:
echo "sha=${GITHUB_SHA::7}" >> $GITHUB_OUTPUTFor multi-line values, use the heredoc-style delimiter:
{
echo 'changelog<<EOF'
cat CHANGELOG.md
echo 'EOF'
} >> $GITHUB_OUTPUTHow to read
Reference by step id + output name. Example: steps.meta.outputs.sha.
Steps in different jobs can't read each other's outputs directly. Use job outputs (next lesson) for that.