An issue with "gh release create" and published assets #139495
-
Select Topic AreaBug BodyHello I found not all assets published when I run "gh release create". Here you can find sample code how it could be reproduced: Github workflow:
Expected outcome:
Actual outcome:
Workflow output:
And I see only 5 published assets:
I expect 6 assets will be published as they all matching *.tar.gz pattern. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
Beta Was this translation helpful? Give feedback.
-
The issue with only 5 assets being published instead of the expected 6 when using the gh release create .tar.gz command is likely due to how the shell is expanding the wildcard (.tar.gz) and passing the filenames to the command. If one of the files is not being passed or recognized correctly, it could cause only 5 assets to be uploaded. Here are some possible reasons and solutions to consider:
Ensure that all files are correctly created and visible at the time the gh release create command is executed. There might be a race condition where one file is not completely written or not accessible at the moment the wildcard is expanded. Fix: Add a delay before the gh release create step or explicitly list the files to confirm that all 6 archives are present: bash ls -l *.tar.gz
The wildcard expansion relies on the file system. If there is any caching or if two files have similar names that might be causing a conflict, one file may be missed during the expansion. Fix: Use an explicit list of files instead of relying on *.tar.gz: bash gh release create archive_${{ inputs.version }}linux_arm64.tar.gz archive${{ inputs.version }}linux_amd64.tar.gz archive${{ inputs.version }}linux_amd64v2.tar.gz archive${{ inputs.version }}darwin_amd64.tar.gz archive${{ inputs.version }}darwin_arm64.tar.gz archive${{ inputs.version }}_darwin_amd64v2.tar.gz
Sometimes the GitHub CLI (gh) can have issues when uploading multiple files using wildcard patterns. If one file fails to upload, it might silently skip that file without throwing an error. Fix: Explicitly mention each file or iterate over the files and upload them one by one: bash for file in *.tar.gz; do
If one of the files has a specific issue (corrupt, zero size, or some other anomaly), it might not be uploaded. Even though it is created and visible, the gh release create might silently ignore it. Fix: Verify the size and contents of all 6 files before the upload to ensure they are valid and non-empty.
By addressing these potential causes, you should be able to ensure that all 6 assets are uploaded as expected. |
Beta Was this translation helpful? Give feedback.
-
Hi
|
Beta Was this translation helpful? Give feedback.
Hi
it was my mistake.
According to the
gh
manual :USAGE gh release create [<tag>] [<files>...]
first non-flag parameter is a tag. So, in my case it is the lost file from the list of files.
I was wrong to think that a tag in square brackets could be skipped.
Sorry for the noise.