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

Use variables in upload-artifact

Solved! Go to Solution.

This seems like it should be super simple:

 

- uses: actions/upload-artifact@master
  with:
    name: my-artifact-${GITHUB_SHA}
    path: path/to/artifact

 

Except this doesn't work - I get quite literally `my-artifact-${GITHUB_SHA}` as name, instead of a name that includes the SHA of the commit on which this is run... 

4 Replies
Solution
Pilot Lvl 1
Message 2 of 5

Re: Use variables in upload-artifact

Use:

${{github.sha}}
Copilot Lvl 2
Message 3 of 5

Re: Use variables in upload-artifact

I'll try that.

Follow up question - is that documented anywhere?

Pilot Lvl 1
Message 4 of 5
Copilot Lvl 3
Message 5 of 5

Re: Use variables in upload-artifact

It woulf be quite useful if we could access the runner context to write e.g. ${{ runner.home }}. This would avoid hard-coded paths when using the upload action:

 

 

        uses: actions/upload-artifact@master
        with:
          name: spider
          path: /Users/runner/collect/spider