fix: make gh pr merge one-command guarded merge (#654)

Co-authored-by: Codex <codex@noreply.local>
This commit is contained in:
Lyon
2026-06-22 14:14:47 +08:00
committed by GitHub
parent 33edd26735
commit 865e81e7f7
3 changed files with 166 additions and 12 deletions
+3 -1
View File
@@ -271,7 +271,9 @@ bun scripts/cli.ts gh pr merge <number> \
[--delete-branch] [--dry-run]
```
guarded merge先做 closeout 预检,拒绝非 ready PR。已 merged 返回 `alreadyMerged=true`
一键 guarded merge`gh pr merge` 自己读取 closeout metadata、mergeability、mergeStateStatus 和 status checks,不要求用户先跑 `gh pr preflight``preflight`/`closeout` 只作为只读诊断入口保留
当 GitHub GraphQL 返回 `mergeable=UNKNOWN/null``mergeStateStatus=UNKNOWN/null` 或 status rollup unknown 且没有明确 blockers 时,`gh pr merge` 会按 `config/unidesk-cli.yaml``github.prMerge.unknownRetry` 做指数退避重试,并在默认表格 `RETRY` 列显示 `1/5``2/5` 等尝试次数。重试耗尽仍 unknown 时,命令自动停止且不合并;冲突、draft、失败检查、pending check 等不可合并状态不会无意义重试。已 merged 返回 `alreadyMerged=true`
### 编辑 / 评论 / 关闭 / 重开