fix(ci): allow re-running releases without artifact conflicts#38
Merged
pjcdawkins merged 3 commits intomainfrom Mar 31, 2026
Merged
fix(ci): allow re-running releases without artifact conflicts#38pjcdawkins merged 3 commits intomainfrom
pjcdawkins merged 3 commits 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 keep the default behavior (fail on conflict) to prevent accidental overwrites. Uses GoReleaser's replace_existing_artifacts field for GitHub. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request updates the GoReleaser configuration to use the new replace_existing_artifacts boolean property instead of the deprecated mode property, while updating the GitHub Actions workflow to set the corresponding environment variable. The change improves clarity by using explicit boolean values (true/false) instead of string modes (replace/append), and maintains the intended behavior: manual workflow_dispatch releases replace existing artifacts, while tag-based releases append them.
Changes:
- Replace deprecated
modeproperty withreplace_existing_artifactsin GoReleaser configuration - Update GitHub Actions workflow to set
REPLACE_EXISTING_ARTIFACTSenvironment variable instead ofRELEASE_MODE - Preserve release behavior: manual triggers set to
true(replace), automatic tag pushes set tofalse(append)
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
.goreleaser.yaml |
Updated release.mode to use new replace_existing_artifacts boolean property with envOrDefault template |
.github/workflows/release.yml |
Updated environment variable from RELEASE_MODE to REPLACE_EXISTING_ARTIFACTS with boolean values 'true'/'false' |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
GoReleaser's YAML parser doesn't support template syntax in boolean fields, so the conditional replace_existing_artifacts logic caused parsing errors. Setting replace_existing_artifacts to true allows re-running releases for existing tags without "already_exists" errors. This applies to both manual and automatic releases. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
modeproperty withreplace_existing_artifactsin GoReleaser configTest plan
🤖 Generated with Claude Code