You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Uploading an artificat to a draft release doesn't work (not found) #6198
I saw some other, similar, bug reports like this. However, I cannot verify the claim that this issue is closed. A difference I noticed to the existing bug reports is, that I am creating a "prerelease", which might make a difference. But should still work.
Thank you for reporting. I've managed to reproduce, and it's bizarre: it looks like although the release was properly created and visible via gh release list (backed by GitHub GraphQL API), the new release is not immediately available to gh release upload (backed by GitHub REST API) until a few seconds later. For about 2 seconds after the creation of the release, GitHub GraphQL and REST APIs are out of sync. I suspect some kind of database or ElasticSearch replication lag.
Your workarounds are either:
Since you are publishing the draft release immediately after uploading the assets, you can just switch to gh release create -p $TAG <files>... invocation, which will upload your assets and publish the release when finished.
Alternatively, you can add a sleep 3 statement before gh release upload step.
We are using this pattern of (create draft, add assets, remove draft) in a bunch of cases. Sometimes with a more variable list of files, or multiple steps of uploading. So this ensures that the draft state only gets removed when everything is complete. But maybe we just need to rework this.
Sometimes with a more variable list of files, or multiple steps of uploading.
You can dynamically resolve a variable list of files in your script to the final set of files, and pass that final set to gh release create as arguments for a single call. You still have flexibility that way.
But If you do need to keep your upload flow as separate commands, then just put a sleep 3 after the gh release create --draft to work around the current API issue at the cost of slowing down your workflow a bit.
So this ensures that the draft state only gets removed when everything is complete.
gh release create will automatically keep the release as draft until all uploads are complete.
Hi, a platform update shipped which will ensure that GraphQL and REST APIs match when listing releases, meaning that gh release list will no longer list releases which subsequently can't be found by referencing its tag name. However, due to platform internals, a small replication lag can occur between creating a draft release and having that release be selectable by its tag name. The workaround remains the same: either
Upload artifacts in the same gh release create call; or
Add a sleep statement after the gh release create operation.
Activity
mislav commentedon Sep 5, 2022
Thank you for reporting. I've managed to reproduce, and it's bizarre: it looks like although the release was properly created and visible via
gh release list(backed by GitHub GraphQL API), the new release is not immediately available togh release upload(backed by GitHub REST API) until a few seconds later. For about 2 seconds after the creation of the release, GitHub GraphQL and REST APIs are out of sync. I suspect some kind of database or ElasticSearch replication lag.Your workarounds are either:
gh release create -p $TAG <files>...invocation, which will upload your assets and publish the release when finished.sleep 3statement beforegh release uploadstep.ctron commentedon Sep 6, 2022
Thanks for taking a look at this.
We are using this pattern of (create draft, add assets, remove draft) in a bunch of cases. Sometimes with a more variable list of files, or multiple steps of uploading. So this ensures that the draft state only gets removed when everything is complete. But maybe we just need to rework this.
ci: work around cli/cli#6198
mislav commentedon Sep 15, 2022
You can dynamically resolve a variable list of files in your script to the final set of files, and pass that final set to
gh release createas arguments for a single call. You still have flexibility that way.But If you do need to keep your upload flow as separate commands, then just put a
sleep 3after thegh release create --draftto work around the current API issue at the cost of slowing down your workflow a bit.gh release createwill automatically keep the release as draft until all uploads are complete.mislav commentedon Oct 14, 2022
Hi, a platform update shipped which will ensure that GraphQL and REST APIs match when listing releases, meaning that
gh release listwill no longer list releases which subsequently can't be found by referencing its tag name. However, due to platform internals, a small replication lag can occur between creating a draft release and having that release be selectable by its tag name. The workaround remains the same: eithergh release createcall; orsleepstatement after thegh release createoperation.fix: 按 tag 首次发布的附件上传改走 release id 直传(0.2.97)
fix: 草稿读回按复制延迟有限重试(0.2.98)