diff --git a/plugins/pilot/skills/pilot/phases/run.md b/plugins/pilot/skills/pilot/phases/run.md index d52a9d0..3c048b0 100644 --- a/plugins/pilot/skills/pilot/phases/run.md +++ b/plugins/pilot/skills/pilot/phases/run.md @@ -67,6 +67,8 @@ bash /scripts/check-docs.sh --docs-dir --strict ```bash # bash /scripts/git-guard.sh push # bash /scripts/git-guard.sh merge-pr --integration --squash + # # 单主干仓库(integration_branch == base_branch)必须再加 --allow-trunk,否则被硬拒绝 + # bash /scripts/git-guard.sh merge-pr --integration --squash --allow-trunk ``` (内置 main/master/develop/preview/integration/release/hotfix + .pilot.yml 实际值,前缀匹配。仅当要临时补充 .pilot.yml 之外的分支时,才可选加 `--protect ""`。) @@ -74,7 +76,12 @@ bash /scripts/check-docs.sh --docs-dir --strict 运行 `bash /scripts/pr-monitor.sh`,对我的每个 open PR: - **`decision=APPROVED` 且 checks 通过** → 合并进**集成分支**(不是主干): `bash /scripts/git-guard.sh merge-pr --integration --squash` - (git-guard 会先校验 PR base == `integration_branch`,base 是主干或其它分支会被拒绝;**不加 `--delete-branch`**——远程分支删除统一交给 §合并后的 safe-cleanup,受 `allow_remote_cleanup` 与 dirty-worktree 检查约束)。 + **单主干仓库**(`.pilot.yml` 里 `integration_branch` == `base_branch`,PR 直接开向主干)**必须再加 `--allow-trunk`**: + `bash /scripts/git-guard.sh merge-pr --integration --squash --allow-trunk` + ——不加就会被 git-guard 硬拒绝(`integration '' is a trunk branch`,rc=3),无人值守就停在这一步。 + 它**不是绕过**:仍要求该分支的保护规则要求审批、这个 PR 已 `APPROVED`、且该分支开启了 stale-dismissal, + 三条任一读不到就 fail-closed 拒绝(见 SKILL.md §doctor 第 4 步)。 + (git-guard 会先校验 PR base == `integration_branch`,base 是其它分支会被拒绝;**不加 `--delete-branch`**——分支清理统一交给 §合并后的 safe-cleanup。) 合并后:把对应 Task 在 `tasks.md` 标 `DONE`、更新 `progress.md`,运行 `bash /scripts/safe-cleanup.sh --squash-merged --integration [--protect ""] [--remote-name ] --apply` 清掉本地已合并分支/worktree(**必须显式带上与 `.pilot.yml` 一致的 `--integration`/`--protect`,不要依赖脚本猜默认值**)。脚本只会 `git branch -d`;squash 合并的分支和 worktree 它**只列出来**,把清单原样报给用户,不要代劳删。**远程分支脚本不处理**——让用户在仓库设置里开 GitHub 的 auto-delete-on-merge。**做完回到主循环顶端,继续下一项。**