Skip to content

Dynamic naming of build artifacts based on commit reference #25463

Answered by airtower-luna
Jademalo asked this question in Actions
Discussion options

You must be logged in to vote

Basically yes! Though I assume that the folder name is going to be a bit too dynamic to set it in the workflow or job, so it’s probably best to create it in a step and write it to the environment file so it’s available to the following steps:

      - name: Set folder name
        run: |
          echo "folder_name=$(some_command_to_find_the_folder)" >> $GITHUB_ENV
      - name: Upload Retail Artifact
        uses: actions/upload-artifact@v2
        with:
          name: ${{ env.folder_name }}-${{ github.sha }}
          path: .release/*/

The code in the run step is regular Bash. You can use other interpreters or call scripts, the important thing is that the folder_name=... assignment end…

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

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