Skip to content

Fix release branch resolution picking stale feature branches#359

Merged
Devesh-Skyflow merged 1 commit into
mainfrom
fix/resolve-release-branch-points-at
Jul 20, 2026
Merged

Fix release branch resolution picking stale feature branches#359
Devesh-Skyflow merged 1 commit into
mainfrom
fix/resolve-release-branch-points-at

Conversation

@saileshwar-skyflow

@saileshwar-skyflow saileshwar-skyflow commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • The "Resolve Branch for the Tagged Commit" step in shared-build-and-deploy.yml used git branch -r --contains $TAG_COMMIT, which matches any remote branch that has the tag commit as an ancestor — not just the branch the tag was cut from.
  • Long-lived or merged feature branches retain that ancestry indefinitely, and git branch -r sorts alphabetically, so head -n 1 could pick the wrong branch (e.g. a stale SK-2967-... branch instead of main) on a recent public release.
  • That wrong branch then caused git checkout $BRANCH_NAME in the "Commit changes" step to fail, since its pom.xml differed from the uncommitted version bump on the tag commit.
  • Fix: use git for-each-ref --points-at="$TAG_COMMIT" to match only the branch whose tip is exactly the tag commit, filtering out the origin/HEAD symref entry.

git branch -r --contains matches any branch that has the tag commit
as an ancestor, not just the branch it was cut from. Long-lived or
merged branches keep that ancestry indefinitely, so alphabetical
head -n 1 could select the wrong branch (e.g. a stale feature branch
instead of main), which then made the checkout in the Commit changes
step collide with the uncommitted pom.xml version bump.

Switch to git for-each-ref --points-at to match only the branch whose
tip is exactly the tag commit.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Gitleaks Findings: No secrets detected. Safe to proceed!

@github-actions

Copy link
Copy Markdown

Semgrep Findings: Issues with Error level severity are found (Error is Highest severity in Semgrep), Please resolve the issues before merging.

@Devesh-Skyflow
Devesh-Skyflow merged commit 969eaac into main Jul 20, 2026
4 of 5 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.

2 participants