Repository navigation
fix(publish): push the current branch when git.branch is unset - #696
Merged
Merged
Conversation
GitConfigSchema.branch defaulted to 'main', and mergeGitConfig fell back to 'main' when only publish.git was set, so any config with a git or publish.git block handed publish branch 'main'. A direct release from another branch then ran `git push <remote> main`, leaving the release commit local while the tags were pushed. Drop both defaults so an unset branch reaches publish as undefined and the current-branch fallback runs. The standing PR's base still defaults to main. Closes #688 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Standing release PR: #614 · v0.42.0 queued (4 packages) · open 82d 4h 21m · ✅ ready to merge Release Preview — v0.41.2 → v0.41.3
These changes will be added to the release PR (#614) when merged: Changelogmonorepo 0.41.2 → 0.41.3
After merge — predicted release
Updated automatically by ReleaseKit |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 22, 2026
Merged
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.
Description
GitConfigSchema.branchdefaulted to'main', andmergeGitConfigfell back to'main'when onlypublish.gitwas set. So any config with agitorpublish.gitblock made publish rungit push <remote> main, and a direct release from another branch left the release commit local while pushing its tags.Both defaults are gone: an unset branch reaches publish as
undefined, and the existing current-branch fallback runs. The standing PR's base still defaults tomain(git?.branch ?? 'main'). Nothing else readsgit.branch: preview, draft, backfill, version, notes and the Action all checked. The schema description now states both fallbacks; schema and config docs regenerated.A direct release from a detached HEAD with a
gitblock but nogit.branchnow stops with the existing "detached HEAD — set git.branch or pass --branch" error, instead of pushing a localmainthat doesn't hold the release commit.Related Issue(s)
Closes #688
Type of Change
feat— New featurefix— Bug fixdocs— Documentation changerefactor— Code refactoringtest— Adding or updating testschore— Maintenance, dependencies, toolingScope
@releasekit/version@releasekit/notes@releasekit/publish@releasekit/release@releasekit/config@releasekit/coreChecklist
pnpm lint)pnpm test)pnpm typecheck)Testing Notes
git-push.spec.tsloads real configs (git,git+publish,publish.git) with no branch, onfeature/my-branch, and asserts that branch is pushed. The last two pushedmainbefore the fix; thegit-only row starts mattering once fix(publish)!: apply schema publish defaults when the config has no publish block #690 merges the top-levelgitconfig without apublishblock.mergeGitConfigleaves branchundefinedwhen neither level sets it.mainwhengit.branchis unset.main: config, publish and release suites pass (turbo run test --force);schema:checkanddocs:checkclean.#684 also edits
git-push.spec.ts, so whichever merges second may need a small rebase.🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge.Summary
Removes the implicit
maindefault so publishing uses the current branch whengit.branchis unset.git.branchis unset.No actionable issues found. Tests were inspected, not run.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A[git.branch unset] --> B[Schema and merge leave it unset] B --> C[Direct publish] B --> D[Standing release PR update] C --> E[Push current branch] C --> F[Detached HEAD: stop with error] D --> G[Use main as PR base]Reviews (1) · Last reviewed commit: "fix(publish): push the current branch wh..." · Reviewed by Greptile