Repository navigation
fix(ci): create release tags on main via merge_commit_sha - #15
Merged
Merged
Conversation
The marketplace publish workflow resolved GIT_REF from the PR head.sha, so on a squash merge the tag was created on an orphan commit off main. Use merge_commit_sha (points at the commit on main for both merge and squash) and require merged == true before publishing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
The release tags
v3.54.9~v3.54.13were all created outsidemain(on orphan commits), so tools likegit describeandgit branch --containscannot associate them withmain.Root cause
marketplace-publish.ymlresolvesGIT_REFfrom the PRhead.sha:The workflow checks out that ref on
pull_request: [closed]and runsgit tagon its HEAD. When the PR is merged with squash, the commit referenced byhead.shanever entersmain's history (it becomes an orphan), so the tag is created on that orphan commit too.Earlier PRs merged with a merge commit happened to make
head.shaan ancestor of the merge commit, so the tags were "on main" by luck; switching to squash exposed the bug.Fix
merge_commit_shaforGIT_REF: it points at the commit onmainfor both merge and squash strategies, so checkout,git tag, andgh release create --targetall land onmain.github.event.pull_request.merged == trueso a same-named but unmerged (closed only) PR cannot trigger a publish — otherwisemerge_commit_shaisnull, makingGIT_REFempty and failing checkout.Verification plan
After this PR is merged, on the next "Changeset version bump" PR merge, confirm the new
vX.Y.Ztag is onmain(git merge-base --is-ancestor <tag> main).