Finish a PR safely: sync branch, run required checks, handle CodeRabbit comments, and push without leaking secrets.
Use this workflow when a PR is near merge and needs a final pass for CI and CodeRabbit.
bun is installed and works in this repo.gh is installed and authenticated (gh auth status).env, printenv, or gh auth token.set -x in shell sessions when running GitHub commands.gh api and gh pr view over manual curl with auth headers.git status --short --branch
git fetch origin
git merge origin/main
If conflicts appear: resolve, run checks, commit conflict resolution.
bun run type-check
bun run lint
bun run static-check
gh pr checks <PR_NUMBER>
If failing, fix the first root cause, then re-run local gates.
gh api graphql -f query='
query {
repository(owner:"<OWNER>", name:"<REPO>") {
pullRequest(number:<PR_NUMBER>) {
reviewThreads(first:100) {
nodes {
id
isResolved
comments(first:20) {
nodes { body url author { login } }
}
}
}
}
}
}
' --jq '.data.repository.pullRequest.reviewThreads.nodes
| map(select(.isResolved==false))
| map({id, comments:[.comments.nodes[] | {author:.author.login, url, body}]})'
bun run static-check
gh pr checks <PR_NUMBER>
git push
gh pr checks <PR_NUMBER> shows all required checks passing.