Fix actions/download-artifact v4 #11754
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Improve repo
Description
Bug 1
This issue originally came up when a PR was failing the check-url action at the download artifact step. At the time, downgrading download-artifact to v3 resolved the issue. Since that version is now being deprecated, a new solution is needed.
After some investigation, I have found that the download only fails when a file is named
README.md
specifically. While I don't understand the root cause behind this issue (I am 99% sure it is in the upstream repo), we can get around it by simply renaming README.md before uploading it. This does not change the file name in the repo, just the artifact.Bug 2
As I was working on this, I found another issue that was due to a problem with our action. If someone update two files with the same name (ex.
README.md
anddocs/README.md
) the upload step fails because the file names are identical. Previously we would strip the path from the file name so both of the example files would be uploaded asREADME.md
. I have updated the upload step to use the entire path of the file to avoid this problem. Now the example files would be uploaded asREADME.md
anddocs-README.md
respectively.Checklist:
Follow-up
Closes #11749