How do you pass an output value from a reusable workflow back to the caller workflow?
Select an answer to reveal the explanation.
Short Explanation and Infographic
Reusable workflow outputs are declared in the on.workflow_call.outputs block, sourced from job outputs inside the called workflow.
Full explanation below image
Full Explanation
To return data from a reusable workflow: (1) In the called workflow, define 'on.workflow_call.outputs:' with output names mapped to job outputs using '${{ jobs.<job_id>.outputs.<name> }}'; (2) The caller accesses these via '${{ needs.<job_name>.outputs.<name> }}'. This is similar to how job outputs work but at the workflow level. Environment variables don't cross the workflow call boundary. Artifacts work for files but require extra steps and aren't accessible directly as expression values. The 'with:' block is for inputs to the called workflow, not for returning values.