Skip to content

[15.x] Fail the release when the tag is not on its release branch - #4669

Merged
jbogard merged 2 commits into
release/15.xfrom
ci/verify-release-tag-branch-15x
Oct 26, 2026
Merged

jbogard merged 2 commits into
release/15.xfrom
ci/verify-release-tag-branch-15x

Conversation

@jbogard

@jbogard jbogard commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Before building, the release workflow now checks that the tagged commit is on the right branch: release/<major>.x if that branch exists, otherwise main. If it isn't, the release fails before anything is built, signed or pushed to NuGet.

Why

In #4620, v15.1.1 and v15.1.2 were created through the GitHub Releases UI. Entering the tag name before picking the branch creates the tag on the default branch, so both "15.x" packages were built from 16.x code (main at 1af71bfe). The UI makes this mistake easy to repeat, and nothing in the pipeline caught it.

How

  • The step runs right after checkout in the first release job. The publishing job needs that job, so a failed check stops the release.
  • The tag's major version picks the branch, so v15.* requires release/15.x. If a release/16.x branch is ever created, v16.* tags will then require it automatically.
  • The step uses shell: bash, which also works on the Windows runner.
  • On failure, the error says which branch the tag should be on.

Verification

I ran the same script locally against existing tags:

Tag Result
v15.1.1 ❌ not on release/15.x
v15.1.2 ❌ not on release/15.x
v15.1.3 ✅ on release/15.x
v16.2.0 ✅ on main
v16.0.0-beta-1 ✅ on main

Workflow YAML parses, and job dependencies are unchanged.

Companion PR for main: #4668

🤖 Generated with Claude Code

A tag created from the GitHub Releases UI can land on the default branch
instead of the selected one, which is how v15.1.1 and v15.1.2 were built
from 16.x code (#4620). Before building, verify the tagged commit is on
release/<major>.x when that branch exists, otherwise on main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-26T22:13:10.789405Z 06e094a New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

git ls-remote --exit-code returns 2 for no matching refs and 128 for a
failed lookup. Treating any failure as "no release branch" could let a
transient error pass a v15.* tag on main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jbogard
jbogard merged commit 24ae647 into release/15.x Oct 26, 2026
2 checks passed
@jbogard
jbogard deleted the ci/verify-release-tag-branch-15x branch October 26, 2026 22:18
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.

1 participant