fix(ci): allow asset replacement on manual workflow_dispatch#37
Merged
pjcdawkins merged 1 commit intomainfrom Mar 31, 2026
Merged
fix(ci): allow asset replacement on manual workflow_dispatch#37pjcdawkins merged 1 commit intomainfrom
pjcdawkins merged 1 commit intomainfrom
Conversation
When manually re-running the release workflow for an existing tag, GoReleaser will now replace existing assets instead of failing with a 422 "already_exists" error. Automatic tag pushes still use append mode to prevent accidental overwrites. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements conditional release mode configuration in GoReleaser based on the GitHub Actions workflow trigger type. When the release workflow is manually triggered via workflow_dispatch, it sets the release mode to replace, allowing re-running failed releases or fixing assets without encountering "asset already exists" errors. For automatic releases triggered by pushing a tag, it keeps the default append mode.
Changes:
- Added environment variable configuration to
.goreleaser.yamlthat reads theRELEASE_MODEvariable with a default ofappend - Added conditional logic to
.github/workflows/release.ymlto setRELEASE_MODEtoreplacefor manual workflow_dispatch triggers andappendfor automatic tag push triggers
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| .goreleaser.yaml | Added release mode configuration using environment variable with default value |
| .github/workflows/release.yml | Added conditional environment variable to control release mode based on trigger type |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
pjcdawkins
approved these changes
Mar 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
replacewhen workflow is manually triggered via workflow_dispatchappendmode for automatic releasesWhy
Allows re-running failed releases or fixing release assets by manually triggering the workflow without encountering "asset already exists" errors.
Test plan
🤖 Generated with Claude Code