Use variables in upload-artifact

This seems like it should be super simple:

-uses:actions/upload-artifact@masterwith:
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… 

3 Likes

Use:

${{github.sha}}
5 Likes

I’ll try that.

Follow up question - is that documented anywhere?

https://help.github.com/en/articles/contexts-and-expression-syntax-for-github-actions

2 Likes

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
1 Like