Skip to content

fix(ci): allow re-running releases without artifact conflicts#38

Merged
pjcdawkins merged 3 commits intomainfrom
fix-replace-artifacts
Mar 31, 2026
Merged

fix(ci): allow re-running releases without artifact conflicts#38
pjcdawkins merged 3 commits intomainfrom
fix-replace-artifacts

Conversation

@miguelsanchez-upsun
Copy link
Copy Markdown
Collaborator

@miguelsanchez-upsun miguelsanchez-upsun commented Mar 31, 2026

Summary

  • Replace mode property with replace_existing_artifacts in GoReleaser config

Test plan

  • Verify GoReleaser config validates
  • Test manual workflow_dispatch trigger replaces artifacts
  • Test tag push (non-workflow_dispatch) appends artifacts

🤖 Generated with Claude Code

miguelsanchez-upsun and others added 2 commits March 31, 2026 11:13
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>
Copilot AI review requested due to automatic review settings March 31, 2026 09:30
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 mode property with replace_existing_artifacts in GoReleaser configuration
  • Update GitHub Actions workflow to set REPLACE_EXISTING_ARTIFACTS environment variable instead of RELEASE_MODE
  • Preserve release behavior: manual triggers set to true (replace), automatic tag pushes set to false (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>
@miguelsanchez-upsun miguelsanchez-upsun changed the title fix(ci): simplify artifact replacement in GoReleaser fix(ci): allow re-running releases without artifact conflicts Mar 31, 2026
@pjcdawkins pjcdawkins merged commit 89bfb00 into main Mar 31, 2026
4 checks passed
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.

3 participants