diff --git a/.github/workflows/codex-review-gate.yml b/.github/workflows/codex-review-gate.yml index deba73f..ab2af36 100644 --- a/.github/workflows/codex-review-gate.yml +++ b/.github/workflows/codex-review-gate.yml @@ -17,7 +17,7 @@ on: permissions: contents: read issues: write - pull-requests: read + pull-requests: write statuses: write concurrency: diff --git a/docs/CODEX_REVIEW_GATE.md b/docs/CODEX_REVIEW_GATE.md index 9c34aae..5b97855 100644 --- a/docs/CODEX_REVIEW_GATE.md +++ b/docs/CODEX_REVIEW_GATE.md @@ -47,4 +47,4 @@ workflow 合入默认分支并至少运行一次后,把 `codex/review-gate` 不要在 workflow 还没进入受保护分支前提前要求 `codex/review-gate`,否则当前引入 PR 会被一个没有 runner 能创建的 required status 卡住。 -workflow 使用 `GITHUB_TOKEN`,这样 marker comment 的作者会是 `github-actions[bot]`。为了让信号最干净,建议关闭 Codex automatic review-on-push,只让这个 gate comment 触发当前 head review。 +workflow 使用 `GITHUB_TOKEN`,这样 marker comment 的作者会是 `github-actions[bot]`。实测创建 PR conversation comment 需要 workflow token 同时具备 `issues: write` 与 `pull-requests: write`。为了让信号最干净,建议关闭 Codex automatic review-on-push,只让这个 gate comment 触发当前 head review。 diff --git a/docs/PROJECT_STATE.md b/docs/PROJECT_STATE.md index 9f56d84..3c3df62 100644 --- a/docs/PROJECT_STATE.md +++ b/docs/PROJECT_STATE.md @@ -17,6 +17,7 @@ - workflow 落到默认分支后,还需要把 `codex/review-gate` 加进远端 ruleset 的 required status checks。 - 2026-04-25 用临时非默认 base branch 测试过:PR 只触发普通 `pull_request` CI,没有触发 `Codex Review Gate`;真实 GitHub Actions bot 路径要等 workflow 进入 repository default branch 后再测。 - 2026-04-25 在默认分支首次实测时,`Codex Review Gate` 成功触发并写入 `codex/review-gate` status,但 marker comment 创建失败:workflow 选择了 `CODEX_REVIEW_GATE_TOKEN` secret,导致 `POST /issues/8/comments` 返回 `403 Resource not accessible by integration`。当前修正方向是强制使用 `github.token`,保证 marker 身份是 `github-actions[bot]`。 +- 强制使用 `github.token` 后,`GITHUB_TOKEN` 日志显示 `Issues: write` / `PullRequests: read` 仍无法创建 PR conversation comment;下一步把 `pull-requests` 权限提升到 `write` 后复测。 ## 当前架构方向