-
Notifications
You must be signed in to change notification settings - Fork 23
Use unique artifact identifier in upload-artifact step #648
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
54820bc
to
b35a120
Compare
This branch fixes the issue I was having in our codebase |
3356a86
to
560844a
Compare
- name: Add artifact link to summary | ||
run: | | ||
echo "-------------" >> $GITHUB_STEP_SUMMARY | ||
echo "Download receipt: [${{ steps.upload-artifact.outputs.artifact-url }}](${{ steps.upload-artifact.outputs.artifact-url }})" >> $GITHUB_STEP_SUMMARY |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's already a link. Is it necessary to wrap it like this?
echo "Download receipt: [${{ steps.upload-artifact.outputs.artifact-url }}](${{ steps.upload-artifact.outputs.artifact-url }})" >> $GITHUB_STEP_SUMMARY | |
echo "Download receipt: ${{ steps.upload-artifact.outputs.artifact-url }}" >> $GITHUB_STEP_SUMMARY |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point 😅
I adjusted the PR
560844a
to
22da139
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
Issue
Fixes #644
Since upload-artifact@v4, uploading again the same artifact name in a workflow fails the step.
Using a hardcoded
experiment-X-receipt
is not valid anymoreFix
Use a unique name. This is not so straightforward as some collisions can occur in the case of matrix.
Using the
job-index
for matrix solves this.Note that appending the
job-index
is happening only ifjob-total > 1
to not suffix artifacts from non matrix scenarioThis could hopefully get simplified if/when GitHub starts to expose a unique
job-id
when running with matrix strategy.Extra
A receipt download link has been added as part of the workflow summary
Example
See a summary running with the PR fix here