Skip to content

Fix GoReleaser using wrong tag for concurrent releases#918

Merged
gtrrz-victor merged 3 commits intomainfrom
force-goreleaser-use-specific-tag
Apr 10, 2026
Merged

Fix GoReleaser using wrong tag for concurrent releases#918
gtrrz-victor merged 3 commits intomainfrom
force-goreleaser-use-specific-tag

Conversation

@gtrrz-victor
Copy link
Copy Markdown
Contributor

@gtrrz-victor gtrrz-victor commented Apr 10, 2026

Summary

  • Resolve the release tag once as workflow env.RELEASE_TAG (manual workflow_dispatch version input or github.ref_name on tag push) so checkout, GoReleaser, and failure notifications all use the same value
  • Set GORELEASER_CURRENT_TAG to ${{ env.RELEASE_TAG }} so GoReleaser does not auto-detect the wrong tag when nightly and stable releases are created from the same commit
  • Support workflow_dispatch with a required version input for manual releases

Test plan

  • Push a nightly and stable tag on the same commit and verify each release uses the correct version
  • Run the workflow manually with version set to an existing tag and confirm checkout and artifacts match that tag

🤖 Generated with Claude Code


Note

Medium Risk
Touches the release pipeline by overriding GoReleaser tag detection, which could impact versioning/published artifacts if misconfigured, but the change is small and isolated to CI.

Overview
Ensures concurrent tag-based releases (e.g., nightly and stable from the same commit) use the intended version by explicitly setting GORELEASER_CURRENT_TAG to github.ref_name in the GitHub Actions release.yml GoReleaser step.

Reviewed by Cursor Bugbot for commit 6394501. Configure here.

… same commit

Set GORELEASER_CURRENT_TAG to the tag that triggered the workflow,
preventing GoReleaser from auto-detecting the wrong tag when multiple
tags point to the same commit.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 529d3467b937
@gtrrz-victor gtrrz-victor requested a review from a team as a code owner April 10, 2026 14:52
Copilot AI review requested due to automatic review settings April 10, 2026 14:52
pjbgf
pjbgf previously approved these changes Apr 10, 2026
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

Ensures GoReleaser uses the correct tag when multiple tags (e.g., nightly and stable) point to the same commit, preventing version mix-ups during concurrent releases.

Changes:

  • Sets GORELEASER_CURRENT_TAG to ${{ github.ref_name }} in the release workflow to override GoReleaser’s tag auto-detection.

@gtrrz-victor
Copy link
Copy Markdown
Contributor Author

Added workflow_dispatch support with a version input for manual releases. Unified all tag references through a RELEASE_TAG job-level env var that resolves correctly for both push and manual dispatch triggers. Slack failure notifications also updated.

Add version input to workflow_dispatch trigger and unify all tag
references through a RELEASE_TAG job-level env var that resolves
correctly for both push and manual dispatch triggers.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: cf7894a93e60
@gtrrz-victor gtrrz-victor force-pushed the force-goreleaser-use-specific-tag branch from cb202df to afed0d2 Compare April 10, 2026 15:24
Expose the resolved tag once for all jobs (checkout, GoReleaser, Slack
notifications) and reuse env.RELEASE_TAG in expressions.

Made-with: Cursor
Entire-Checkpoint: 06c12cb77931
@gtrrz-victor gtrrz-victor enabled auto-merge April 10, 2026 15:50
Copy link
Copy Markdown
Member

@pjbgf pjbgf left a comment

Choose a reason for hiding this comment

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

In the future we could add some validation - if the tag does not align with a given pattern it stops early.

I think we have some sort of validation on the script, but it would be good a fail safe earlier.

@gtrrz-victor gtrrz-victor merged commit 1badb30 into main Apr 10, 2026
9 checks passed
@gtrrz-victor gtrrz-victor deleted the force-goreleaser-use-specific-tag branch April 10, 2026 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants