Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 2
Message 1 of 3

Use output from a step in a previous job

I currently have a single job containing a bunch of steps, which conceptually can be divided in three parts: A, B and C. A collects some data, and B and C use this data. Since B and C don't actually depend on each other, I tried to split them to run them in parallel:

 

Before:

 

jobs:
  A:
    steps:
      - id: get_data
        uses: ./action-A
      - uses: ./action-B
        with:
          data: ${{ steps.get_data.outputs.data }}
- uses: ./action-C
with:
data: ${{ steps.get_data.outputs.data }}

 

 

After:

 

jobs:
  A:
    steps:
      - id: get_data
        uses: ./action-A

  B:
needs: A steps: - uses: ./action-B with: data: ${{ ?? }} C:
needs: A steps: - uses: ./action-C with: data: ${{ ?? }}

 

 

What can I use instead of ?? to get the output generated by the step in the first job?

2 Replies
Pilot Lvl 1
Message 2 of 3

Re: Use output from a step in a previous job

Any idea on how to solve this? In my case, job B and C need to run on different platforms (ubuntu, windows and macOS), so I cannot leave them all in the job A...

GitHub Staff
Message 3 of 3

Re: Use output from a step in a previous job

Hey @BotellaA!

 

I'm a product manager on the GitHub Actions team. Sorry for the delay in responding! Since you would like to use B and C in parallel and on different platforms. I think what you'd like to do is use

 

https://github.com/marketplace/actions/upload-artifact

https://github.com/marketplace/actions/download-artifact

 

These allow you to save data from a job, which you can manually access yourself, or pull down as part of another job. Give it try and let us know!