Skip to content

fix: release branch publishing not to commit to main#6275

Merged
KevinVandy merged 3 commits into
alphafrom
release-branch
May 18, 2026
Merged

fix: release branch publishing not to commit to main#6275
KevinVandy merged 3 commits into
alphafrom
release-branch

Conversation

@KevinVandy
Copy link
Copy Markdown
Member

@KevinVandy KevinVandy commented May 17, 2026

🎯 Changes

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with pnpm test:pr.

Summary by CodeRabbit

  • Chores
    • Updated release workflow: publishes from a dedicated release branch with authenticated publishing, attempts to open a version-bump pull request when a new version is produced, and automatically skips PR creation and deletes the temporary branch if no version bump is detected.

Review Change Stack

@KevinVandy KevinVandy requested a review from a team as a code owner May 17, 2026 23:48
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 17, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 29b9cf2c-1123-4819-9117-28a14a8ea259

📥 Commits

Reviewing files that changed from the base of the PR and between c1f4cc6 and a25f0e2.

📒 Files selected for processing (1)
  • .github/workflows/release.yml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/release.yml

📝 Walkthrough

Walkthrough

The release workflow adds top-level pull-requests: write, moves GH_TOKEN to workflow env, creates/pushes a release/<ref>/version-bump-... branch, runs pnpm run cipublish with BRANCH and TAG, then either opens a version-bump PR or deletes the branch if no version bump commit was produced.

Changes

Release workflow PR creation

Layer / File(s) Summary
Workflow permissions and env
.github/workflows/release.yml
Adds workflow-level pull-requests: write permission and moves GH_TOKEN into the workflow env for cross-step use.
Prepare and push release branch
.github/workflows/release.yml
Creates and pushes a dedicated release branch and exposes its name via steps.release-branch.outputs.branch for subsequent publish and PR steps.
Publish with branch context and conditional PR
.github/workflows/release.yml
Configures git author/committer as github-actions[bot], runs pnpm run cipublish with BRANCH and TAG, checks origin/<base>..HEAD for version-bump commits, deletes the branch if none, or opens a version-bump PR with gh pr create if present.

Sequence Diagram(s)

sequenceDiagram
  participant GitHubActions
  participant ReleaseJob
  participant Git
  participant pnpm_cipublish
  participant GitHubCLI
  GitHubActions->>ReleaseJob: trigger release job
  ReleaseJob->>Git: create and push release/<ref>/version-bump branch
  ReleaseJob->>pnpm_cipublish: run `pnpm run cipublish` (BRANCH, TAG)
  pnpm_cipublish->>Git: create version-bump commit (optional)
  ReleaseJob->>Git: git rev-list --count origin/<base>..HEAD
  alt version-bump commit exists
    ReleaseJob->>GitHubCLI: gh pr create (open version-bump PR)
    GitHubCLI->>GitHubActions: PR created
  else no version-bump commit
    ReleaseJob->>Git: delete release branch
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

A rabbit hops through workflows bright,
Creating branches in the night,
It runs the publish, checks the logs,
Opens PRs or clears the bogs,
🐇✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: release branch publishing not to commit to main' directly addresses the PR's objective to prevent commits to main during release branch publishing, accurately summarizing the primary change.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch release-branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented May 17, 2026

View your CI Pipeline Execution ↗ for commit a25f0e2

Command Status Duration Result
nx affected --targets=test:eslint,test:sherif,t... ✅ Succeeded 35s View ↗
nx run-many --targets=build --exclude=examples/** ✅ Succeeded 1s View ↗

☁️ Nx Cloud last updated this comment at 2026-05-18 02:32:26 UTC

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 17, 2026

More templates

@tanstack/angular-table

npm i https://pkg.pr.new/TanStack/table/@tanstack/angular-table@6275

@tanstack/lit-table

npm i https://pkg.pr.new/TanStack/table/@tanstack/lit-table@6275

@tanstack/match-sorter-utils

npm i https://pkg.pr.new/TanStack/table/@tanstack/match-sorter-utils@6275

@tanstack/preact-table

npm i https://pkg.pr.new/TanStack/table/@tanstack/preact-table@6275

@tanstack/preact-table-devtools

npm i https://pkg.pr.new/TanStack/table/@tanstack/preact-table-devtools@6275

@tanstack/react-table

npm i https://pkg.pr.new/TanStack/table/@tanstack/react-table@6275

@tanstack/react-table-devtools

npm i https://pkg.pr.new/TanStack/table/@tanstack/react-table-devtools@6275

@tanstack/solid-table

npm i https://pkg.pr.new/TanStack/table/@tanstack/solid-table@6275

@tanstack/solid-table-devtools

npm i https://pkg.pr.new/TanStack/table/@tanstack/solid-table-devtools@6275

@tanstack/svelte-table

npm i https://pkg.pr.new/TanStack/table/@tanstack/svelte-table@6275

@tanstack/table-core

npm i https://pkg.pr.new/TanStack/table/@tanstack/table-core@6275

@tanstack/table-devtools

npm i https://pkg.pr.new/TanStack/table/@tanstack/table-devtools@6275

@tanstack/vue-table

npm i https://pkg.pr.new/TanStack/table/@tanstack/vue-table@6275

@tanstack/vue-table-devtools

npm i https://pkg.pr.new/TanStack/table/@tanstack/vue-table-devtools@6275

commit: a25f0e2

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
.github/workflows/release.yml (1)

44-50: ⚖️ Poor tradeoff

Consider deferring the branch push until after successful publish.

The release branch is pushed to origin immediately after creation, before the publish step runs. If the publish step fails or creates no version bump commits, the branch remains in origin until the cleanup logic in the final step. However, if the workflow fails during publish, the branch is orphaned.

Consider moving the initial push to after the publish step succeeds, or add error handling to ensure cleanup on publish failure.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/release.yml around lines 44 - 50, The release branch is
pushed to origin immediately in the "Prepare Release PR Branch" step (id:
release-branch) which can leave orphaned branches if publishing fails; change
the workflow so you still create the local branch and echo its name to
GITHUB_OUTPUT but defer git push --set-upstream origin "$branch" until after the
publish step succeeds (or alternatively add explicit error handling/cleanup that
deletes the remote branch on publish failure). Ensure the branch variable and
echo "branch=$branch" remain so later steps can push or clean up using that same
branch name.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/release.yml:
- Around line 60-74: Replace direct template expansion of the step output inside
the run block by injecting it as an environment variable: add an env entry
RELEASE_BRANCH: ${{ steps.release-branch.outputs.branch }} (and move GH_TOKEN
into the same env section) for the step, then update the shell commands in the
run script to use $RELEASE_BRANCH (e.g., git push origin --delete
"$RELEASE_BRANCH", gh pr create --head "$RELEASE_BRANCH") instead of ${ {
steps.release-branch.outputs.branch } } so the step output is consumed via an
env var rather than template expansion.

---

Nitpick comments:
In @.github/workflows/release.yml:
- Around line 44-50: The release branch is pushed to origin immediately in the
"Prepare Release PR Branch" step (id: release-branch) which can leave orphaned
branches if publishing fails; change the workflow so you still create the local
branch and echo its name to GITHUB_OUTPUT but defer git push --set-upstream
origin "$branch" until after the publish step succeeds (or alternatively add
explicit error handling/cleanup that deletes the remote branch on publish
failure). Ensure the branch variable and echo "branch=$branch" remain so later
steps can push or clean up using that same branch name.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6d4b78d0-3c0b-4f30-be46-26af5f5ce2c7

📥 Commits

Reviewing files that changed from the base of the PR and between 24b36ff and 2688514.

📒 Files selected for processing (1)
  • .github/workflows/release.yml

Comment thread .github/workflows/release.yml Outdated
@KevinVandy KevinVandy merged commit a06e310 into alpha May 18, 2026
8 checks passed
@KevinVandy KevinVandy deleted the release-branch branch May 18, 2026 18:49
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