fin

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Fin

Fin

Overview

概述

Finish a PR end-to-end: push updates, watch checks, squash-merge, and clean up state.
端到端完成PR处理:推送更新、监控检查、squash-merge、清理状态。

Workflow

工作流程

  1. Identify the PR and target branch.
    • Use
      gh pr view
      (current branch) or
      gh pr list
      to locate it.
  2. Update the PR.
    • Ensure the branch is up to date, run required checks, and push:
      • git status
        , fix issues, then
        git push
        .
  3. Monitor checks until green.
    • Use
      gh pr checks --watch
      or
      gh run watch <run-id>
      .
    • If checks fail, fix, push, and re-watch.
  4. Squash-merge the PR.
    • Prefer
      gh pr merge --squash --delete-branch
      unless repo policy dictates otherwise.
    • If approvals are missing, request them before merging.
  5. Clean up local state.
    • Fetch the updated mainline, switch to it, and delete the merged branch.
  1. 识别PR和目标分支。
    • 使用
      gh pr view
      (当前分支)或
      gh pr list
      定位对应PR。
  2. 更新PR。
    • 确保分支是最新的,运行必要的检查后推送:
      • 执行
        git status
        ,修复问题后运行
        git push
  3. 监控检查直到全部通过。
    • 使用
      gh pr checks --watch
      gh run watch <run-id>
    • 如果检查失败,修复后推送,重新监控。
  4. Squash-merge PR。
    • 优先使用
      gh pr merge --squash --delete-branch
      ,除非仓库政策另有要求。
    • 如果缺少审批,合并前先请求审批。
  5. 清理本地状态。
    • 拉取更新后的主线分支,切换到该分支,删除已合并的分支。

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.
  • 缺少必要检查或审批时不得合并。
  • 合并方式需符合仓库政策。
  • 如果任何步骤被阻塞,说明阻塞原因及所需的下一步操作。