Upload-artifact: Use environment variable in file names

Created on 28 Aug 2020  路  2Comments  路  Source: actions/upload-artifact

Describe the bug
Actually it's maybe more of a feature request. It would be very convenient if environment variables could be used to set the path of the artifacts

Version

  • [ ] V1
  • [x] V2

Environment

  • [ ] self-hosted
  • [x] Linux
  • [ ] Windows
  • [ ] Mac

How to reproduce
Consider the following (non reproducible) action exemple:

    - run: echo "::set-env name=MY_VAR::6"
    - name: Save artifact
      uses: actions/upload-artifact@v2
      with:
        name: Artifact_${MY_VAR}
        path: /path/to/file_${MY_VAR}.extension
bug

All 2 comments

Did you try using ${{ env.MY_VAR }} like in the readme? https://github.com/actions/upload-artifact#environment-variables-and-tilde-expansion

uh. Not sure how I missed that. Was missing the env.

Sorry for having wasted your time :(

Was this page helpful?
0 / 5 - 0 ratings

Related issues

luna-kx picture luna-kx  路  5Comments

davidmoremad picture davidmoremad  路  6Comments

JayFoxRox picture JayFoxRox  路  9Comments

themakshter picture themakshter  路  4Comments

medyagh picture medyagh  路  5Comments