es  ](/en/actions/security-guides/using-githubs-security-features-to-secure-your-use-of-github-actions)
    * [ Automatic token authentication  ](/en/actions/security-guides/automatic-token-authentication)

  * Creating actions 

    * [ About custom actions  ](/en/actions/creating-actions/about-custom-actions)
    * [ Create a Docker container action  ](/en/actions/creating-actions/creating-a-docker-container-action)
    * [ Create a JavaScript action  ](/en/actions/creating-actions/creating-a-javascript-action)
    * [ Create a composite action  ](/en/actions/creating-actions/creating-a-composite-action)
    * [ Metadata syntax  ](/en/actions/creating-actions/metadata-syntax-for-github-actions)
    * [ Dockerfile support  ](/en/actions/creating-actions/dockerfile-support-for-github-actions)
    * [ Set exit codes  ](/en/actions/creating-actions/setting-exit-codes-for-actions)
    * [ Publish in GitHub Marketplace  ](/en/actions/creating-actions/publishing-actions-in-github-marketplace)
    * [ Share from your private repository  ](/en/actions/creating-actions/sharing-actions-and-workflows-from-your-private-repository)
    * [ Share with your organization  ](/en/actions/creating-actions/sharing-actions-and-workflows-with-your-organization)
    * [ Release and maintain actions  ](/en/actions/creating-actions/releasing-and-maintaining-actions)
    * [ CLI setup action  ](/en/actions/creating-actions/developing-a-third-party-cli-action)

  * [ Guides for GitHub Actions  ](/en/actions/guides)

  * [ GitHub Actions ](/en/actions "GitHub Actions") / 
  * [ Using jobs ](/en/actions/using-jobs "Using jobs") / 
  * [ Define outputs for jobs ](/en/actions/using-jobs/defining-outputs-for-jobs "Define outputs for jobs")

#  Defining outputs for jobs

Create a map of outputs for your jobs.

##  Overview

You can use ` jobs.<job_id>.outputs ` to create a ` map ` of outputs for a
job. Job outputs are available to all downstream jobs that depend on this job.
For more information on defining job dependencies, see [ ` jobs.<job_id>.needs
` ](/en/actions/using-workflows/workflow-syntax-for-github-
actions#jobsjob_idneeds) .

Outputs are Unicode strings, and can be a maximum of 1 MB. The total of all
outputs in a workflow run can be a maximum of 50 MB.

Job outputs containing expressions are evaluated on the runner at the end of
each job. Outputs containing secrets are redacted on the runner and not sent
to GitHub Actions.

To use job outputs in a dependent job, you can use the ` needs ` context. For
more information, see " [ Contexts ](/en/actions/learn-github-
actions/contexts#needs-context) ."

**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 " [ Contexts
](/en/actions/learn-github-actions/contexts#matrix-context) ."

###  Example: Defining outputs for a job

    
    
    jobs:
      job1:
        runs-on: ubuntu-latest
        # Map a step output to a job output
        outputs:
          output1: ${{ steps.step1.outputs.test }}
          output2: ${{ steps.step2.outputs.test }}
        steps:
          - id: step1
            run: echo "test=hello" >> "$GITHUB_OUTPUT"
          - id: step2
            run: echo "test=world" >> "$GITHUB_OUTPUT"
      job2:
        runs-on: ubuntu-latest
        needs: job1
        steps:
          - env:
              OUTPUT1: ${{needs.job1.outputs.output1}}
              OUTPUT2: ${{needs.job1.outputs.output2}}
            run: echo "$OUTPUT1 $OUTPUT2"
    

##  Help and support

###  Did this doc help you?

Yes  No

[ Privacy policy ](/en/site-policy/privacy-policies/github-privacy-statement)

###  Help us make these docs great!

All GitHub