Skip to content

fix(ci): allow asset replacement on manual workflow_dispatch#37

Merged
pjcdawkins merged 1 commit intomainfrom
fix-conditional-release-mode
Mar 31, 2026
Merged

fix(ci): allow asset replacement on manual workflow_dispatch#37
pjcdawkins merged 1 commit intomainfrom
fix-conditional-release-mode

Conversation

@miguelsanchez-upsun
Copy link
Copy Markdown
Collaborator

Summary

  • Sets release mode to replace when workflow is manually triggered via workflow_dispatch
  • Keeps default append mode for automatic releases

Why

Allows re-running failed releases or fixing release assets by manually triggering the workflow without encountering "asset already exists" errors.

Test plan

  • Verify automatic releases still use append mode
  • Verify manual workflow_dispatch uses replace mode
  • Test manual re-trigger of release workflow

🤖 Generated with Claude Code

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>
Copilot AI review requested due to automatic review settings March 31, 2026 08:25
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 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.yaml that reads the RELEASE_MODE variable with a default of append
  • Added conditional logic to .github/workflows/release.yml to set RELEASE_MODE to replace for manual workflow_dispatch triggers and append for 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 pjcdawkins merged commit 3172771 into main Mar 31, 2026
8 checks passed
@pjcdawkins pjcdawkins deleted the fix-conditional-release-mode branch March 31, 2026 08:34
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