fin
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseFin
Fin
Overview
概述
Finish a PR end-to-end: push updates, watch checks, squash-merge, and clean up state.
端到端完成PR处理:推送更新、监控检查、squash-merge、清理状态。
Workflow
工作流程
-
Identify the PR and target branch.
- Use (current branch) or
gh pr viewto locate it.gh pr list
- Use
-
Update the PR.
- Ensure the branch is up to date, run required checks, and push:
- , fix issues, then
git status.git push
- Ensure the branch is up to date, run required checks, and push:
-
Monitor checks until green.
- Use or
gh pr checks --watch.gh run watch <run-id> - If checks fail, fix, push, and re-watch.
- Use
-
Squash-merge the PR.
- Prefer unless repo policy dictates otherwise.
gh pr merge --squash --delete-branch - If approvals are missing, request them before merging.
- Prefer
-
Clean up local state.
- Fetch the updated mainline, switch to it, and delete the merged branch.
-
识别PR和目标分支。
- 使用(当前分支)或
gh pr view定位对应PR。gh pr list
- 使用
-
更新PR。
- 确保分支是最新的,运行必要的检查后推送:
- 执行,修复问题后运行
git status。git push
- 执行
- 确保分支是最新的,运行必要的检查后推送:
-
监控检查直到全部通过。
- 使用或
gh pr checks --watch。gh run watch <run-id> - 如果检查失败,修复后推送,重新监控。
- 使用
-
Squash-merge PR。
- 优先使用,除非仓库政策另有要求。
gh pr merge --squash --delete-branch - 如果缺少审批,合并前先请求审批。
- 优先使用
-
清理本地状态。
- 拉取更新后的主线分支,切换到该分支,删除已合并的分支。
Guardrails
操作约束
- Do not merge if required checks or approvals are missing.
- Keep the merge method aligned with repo policy.
- If any step is blocked, state the blocker and required next action.
- 缺少必要检查或审批时不得合并。
- 合并方式需符合仓库政策。
- 如果任何步骤被阻塞,说明阻塞原因及所需的下一步操作。