Skip to content

Commit

Permalink
Use unique artifact name for uploading
Browse files Browse the repository at this point in the history
  • Loading branch information
asvetlov committed Sep 9, 2024
1 parent 394e589 commit 206d13f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,25 @@ inputs:
runs:
using: "composite"
steps:
- name: Calculate target file name
- name: Calculate metadata
id: meta
run: |
import os, secrets
rnd = secrets.token_hex(16)
with open(os.environ["GITHUB_OUTPUT"], "a") as f:
print(f"file=.coverage.{rnd}", file=f)
art = os.environ["ARTIFACT"]
print(f"artifact={art}-{rnd}", file=f)
env:
artifact: ${{ inputs.artifact }}
shell: python
- name: Rename file
run: mv ${{ inputs.file }} ${{ steps.meta.outputs.file }}
shell: bash
- name: Upload coverage artifact
uses: actions/upload-artifact@v4.4.0
with:
name: ${{ inputs.artifact }}
name: ${{ steps.meta.outputs.artifact }}
path: ${{ steps.meta.outputs.file }}
if-no-files-found: error
retention-days: 1
Expand Down

0 comments on commit 206d13f

Please sign in to comment.