-
Notifications
You must be signed in to change notification settings - Fork 0
Fix GoReleaser immutable release error with draft-then-publish workflow #3
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
- Change mode from 'replace' to 'append' to avoid clashing with GitHub immutable releases - Add comprehensive RELEASE.md file documenting the release process Co-authored-by: ericsuh <382805+ericsuh@users.noreply.github.com>
|
This is the actual error thrown in the release: |
ericsuh
left a comment
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.
Try a different fix. I suspect what we need to do is to create releases in draft mode, then add artifacts, then publish. But to do so, we will need to ensure that the Github Action triggers the release, rather than the reverse.
- Change GoReleaser to create draft releases (draft: true) - Add workflow step to automatically publish draft after artifacts upload - Remove mode: append as drafts are mutable by default - Update RELEASE.md to document the draft-then-publish workflow This fixes the "Cannot upload assets to an immutable release" error by ensuring artifacts are uploaded to a mutable draft release before publishing. Co-authored-by: ericsuh <382805+ericsuh@users.noreply.github.com>
- Use github.ref_name context instead of manual GITHUB_REF parsing - Properly quote tag name in gh command for security Co-authored-by: ericsuh <382805+ericsuh@users.noreply.github.com>
- Include --repo flag for clarity and robustness - Ensures command works correctly in all workflow contexts Co-authored-by: ericsuh <382805+ericsuh@users.noreply.github.com>
Fixed in commit d2043eb. The solution creates releases as drafts (which are mutable), uploads all artifacts, then automatically publishes the draft. This avoids the "Cannot upload assets to an immutable release" error.
Implemented in commit d2043eb. GoReleaser now creates draft releases, uploads artifacts to the mutable draft, and then the workflow automatically publishes it using |
GitHub releases become immutable once published, causing "Cannot upload assets to an immutable release" errors when GoReleaser attempts to upload artifacts to already-published releases.
Changes
.goreleaser.yaml: Implemented draft-then-publish workflowdraft: false→draft: trueto create mutable draft releasesmode: replace(not needed for drafts)make_latest: trueto mark as latest when published.github/workflows/release.yml: Added automatic draft publishinggh release editwith proper security and robustnessRELEASE.md: Added comprehensive release process documentationv*tags)How It Works
Configuration Changes
This prevents the "Cannot upload assets to an immutable release" error while maintaining full automation.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.