Skip to content

Use branch's tracking remote in release script#334

Merged
TrevorBurnham merged 1 commit intojameskerr:mainfrom
TrevorBurnham:fix/release-script-tracking-remote
May 6, 2026
Merged

Use branch's tracking remote in release script#334
TrevorBurnham merged 1 commit intojameskerr:mainfrom
TrevorBurnham:fix/release-script-tracking-remote

Conversation

@TrevorBurnham
Copy link
Copy Markdown
Collaborator

Summary

bin/release.mjs (added in #333) hardcoded origin for the sync check and the final push. On a fork-with-upstream setup that's wrong: the local main tracks upstream, and the v* tag has to land on upstream for .github/workflows/publish.yml to fire. As-is, yarn release would push to the fork and silently no-op the publish.

Change

Read the remote from branch.<branch>.remote (the branch's actual upstream tracking remote) and use it for both git fetch and git push. This matches the target git push would use with no args.

Test plan

  • yarn release minor --preview --no-tests on a clean main shows Fetching upstream and would push to upstream rather than origin
  • Real release on the next version cut

Hardcoding `origin` breaks the release flow on a fork-with-upstream
setup: `git fetch origin` and `git push origin` go to the fork,
while the local branch tracks `upstream` and that's where the v*
tag needs to land for the publish workflow to fire.

Read the remote from `branch.<branch>.remote` so push/fetch follow
the same target as `git push` without args.
Copilot AI review requested due to automatic review settings May 6, 2026 02:18
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@TrevorBurnham TrevorBurnham merged commit 1617d3d into jameskerr:main May 6, 2026
1 check passed
@TrevorBurnham TrevorBurnham deleted the fix/release-script-tracking-remote branch May 6, 2026 02:20
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