Skip to content

Upload-artifact : Variable name #26012

Discussion options

You must be logged in to vote

You’ll have to do this in two steps: Assemble the artifact name (or components) from the file and store it in a variable, and then use that in the upload-artifact step. I’d do the first part with a few lines of Python:

- run: |
    prop = dict()
    with open('gradle.properties') as fh:
        for line in fh:
            name, value = line.split('=', 1)
            prop[name.strip()] = value.strip()
print(f'::set-env name=artifact_name::{prop["base_name"]}-'
      f'{prop["game_version"]}-{prop["project-version"]}.jar')

shell: python

  • uses: actions/upload-artifact@v2
    with:
    name: ${{ env.artifact_name }}
    path: # your file goes here

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants