Skip to content

Guard release script against mismatched tags#623

Merged
robmaceachern merged 2 commits into
mainfrom
robmaceachern/release-existing-tag-guard
Jun 17, 2026
Merged

Guard release script against mismatched tags#623
robmaceachern merged 2 commits into
mainfrom
robmaceachern/release-existing-tag-guard

Conversation

@robmaceachern

Copy link
Copy Markdown
Member

Summary

  • Add an explicit existing-tag guard before gh release create runs.
  • Fail when the requested version tag already exists at a different commit than the resolved release target.
  • Allow the script to continue when an existing tag resolves to the same target commit.

Feedback Addressed

Addresses the concern from #622 (comment). The review was valid: gh release create --target only affects auto-created tags, so an existing tag without a release could have caused the release to be created from a different commit than the script printed.

Validation

  • bash -n Scripts/release.sh
  • Scripts/release.sh --version 9.9.9 --dry-run --no-open
  • Scripts/release.sh --version 6.7.2 --target origin/main --dry-run --no-open fails with the new mismatched-tag error
  • Scripts/release.sh --version 6.7.2 --target 6.7.2 --dry-run --no-open reaches the existing-release guard
  • git diff --check

shellcheck is not installed locally.

@johnnewman-square johnnewman-square left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks good. Thanks for making this tweak!

@robmaceachern robmaceachern marked this pull request as ready for review June 17, 2026 16:22
@robmaceachern robmaceachern requested a review from a team as a code owner June 17, 2026 16:22
@robmaceachern robmaceachern merged commit 1237c2b into main Jun 17, 2026
11 checks passed
@robmaceachern robmaceachern deleted the robmaceachern/release-existing-tag-guard branch June 17, 2026 16:22
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.

2 participants