From f48272235c28535fa45b6341ee3e8d31022ad301 Mon Sep 17 00:00:00 2001 From: Jacob Wallraff Date: Fri, 15 Dec 2023 09:34:59 -0800 Subject: [PATCH] Add note about job output scope (#47858) Co-authored-by: Siara <108543037+SiaraMist@users.noreply.github.com> --- .../actions/jobs/section-defining-outputs-for-jobs.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/data/reusables/actions/jobs/section-defining-outputs-for-jobs.md b/data/reusables/actions/jobs/section-defining-outputs-for-jobs.md index c71df3e28f38..500bb1bf9c50 100644 --- a/data/reusables/actions/jobs/section-defining-outputs-for-jobs.md +++ b/data/reusables/actions/jobs/section-defining-outputs-for-jobs.md @@ -6,6 +6,12 @@ Job outputs containing expressions are evaluated on the runner at the end of eac To use job outputs in a dependent job, you can use the `needs` context. For more information, see "[AUTOTITLE](/actions/learn-github-actions/contexts#needs-context)." +{% note %} + +**Note:** `$GITHUB_OUTPUT` is shared between all steps in a job. If you use the same output name in multiple steps, the last step to write to the output will override the value. If your job uses a matrix and writes to `$GITHUB_OUTPUT`, the content will be overwritten for each matrix combination. You can use the `matrix` context to create unique output names for each job configuration. For more information, see "[AUTOTITLE](/actions/learn-github-actions/contexts#matrix-context)." + +{% endnote %} + ### Example: Defining outputs for a job {% raw %}