Skip to content

Support uploads to draft releases#117

Draft
zeitlinger wants to merge 2 commits intotaiki-e:mainfrom
zeitlinger:codex/draft-release-upload
Draft

Support uploads to draft releases#117
zeitlinger wants to merge 2 commits intotaiki-e:mainfrom
zeitlinger:codex/draft-release-upload

Conversation

@zeitlinger
Copy link
Copy Markdown

Summary

Support uploading assets to existing draft releases.

Why

release-plz and similar immutable-release workflows create the GitHub release as a draft first, then upload assets, then publish the release after the matrix succeeds.

The action currently finishes with gh release upload <tag>, which looks up the release by tag and can fail for draft releases.

What changed

  • replace the final gh release upload step with draft-aware upload logic
  • resolve the release by matching tag_name from the releases API
  • fetch the release upload_url and upload assets directly
  • keep reruns idempotent by deleting an existing asset with the same name first
  • document that existing draft releases are supported when using ref

Validation

  • bash -n main.sh
  • shellcheck main.sh

Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
@taiki-e
Copy link
Copy Markdown
Owner

taiki-e commented Apr 26, 2026

Could you tell me what the actual problem you're trying to solve is?

As said in #110, this isn't necessary with tag-based triggers or manual tag specification. Also, since release-based triggers aren't triggered by draft releases, the workflow won't run in the first place.

@zeitlinger
Copy link
Copy Markdown
Author

Could you tell me what the actual problem you're trying to solve is?

As said in #110, this isn't necessary with tag-based triggers or manual tag specification. Also, since release-based triggers aren't triggered by draft releases, the workflow won't run in the first place.

I'll try to dig into this more - to be able to have a reproducer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants