Skip to content

Commit

Permalink
Clarifies outputs in reusable workflows (#32544)
Browse files Browse the repository at this point in the history
Co-authored-by: Joe Clark <31087804+jc-clark@users.noreply.github.com>
  • Loading branch information
APCBoston and jc-clark committed May 31, 2024
1 parent 61e87d2 commit 8ef13b0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion content/actions/using-workflows/reusing-workflows.md
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,11 @@ A reusable workflow may generate data that you want to use in the caller workflo
If a reusable workflow that sets an output is executed with a matrix strategy, the output will be the output set by the last successful completing reusable workflow of the matrix which actually sets a value.
That means if the last successful completing reusable workflow sets an empty string for its output, and the second last successful completing reusable workflow sets an actual value for its output, the output will contain the value of the second last completing reusable workflow.{% endif %}

The following reusable workflow has a single job containing two steps. In each of these steps we set a single word as the output: "hello" and "world." In the `outputs` section of the job, we map these step outputs to job outputs called: `output1` and `output2`. In the `on.workflow_call.outputs` section we then define two outputs for the workflow itself, one called `firstword` which we map to `output1`, and one called `secondword` which we map to `output2`.
The following reusable workflow has a single job containing two steps. In each of these steps we set a single word as the output: "hello" and "world." In the `outputs` section of the job, we map these step outputs to job outputs called: `output1` and `output2`. In the `on.workflow_call.outputs` section we then define two outputs for the workflow itself, one called `firstword` which we map to `output1`, and one called `secondword` which we map to `output2`.

The `value` must be set to the value of a job-level output within the called workflow. Step-level outputs must first be mapped to job-level outputs as shown below.

For more information, see "[AUTOTITLE](/actions/using-jobs/defining-outputs-for-jobs#overview)" and "[AUTOTITLE](/actions/using-workflows/workflow-syntax-for-github-actions#onworkflow_calloutputs)."

{% raw %}

Expand Down

0 comments on commit 8ef13b0

Please sign in to comment.