fix: release branch publishing not to commit to main#6275
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe release workflow adds top-level ChangesRelease workflow PR creation
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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
View your CI Pipeline Execution ↗ for commit a25f0e2
☁️ Nx Cloud last updated this comment at |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
.github/workflows/release.yml (1)
44-50: ⚖️ Poor tradeoffConsider 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
📒 Files selected for processing (1)
.github/workflows/release.yml
🎯 Changes
✅ Checklist
pnpm test:pr.Summary by CodeRabbit