From 44500619ac978257419c16223a3575209bb08684 Mon Sep 17 00:00:00 2001 From: peptiderepo <273788462+peptiderepo@users.noreply.github.com> Date: Tue, 14 Apr 2026 16:52:01 +0700 Subject: [PATCH] ci: post CTO review as COMMENT instead of APPROVE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GITHUB_TOKEN cannot formally approve PRs without a repo setting toggle. Verdict is still prominent in the first line of the review body, and the human merges based on reading it — no behavior loss. Agent-Session: cowork-reviewer-fix-20260414 --- .github/workflows/cto-review.yml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/cto-review.yml b/.github/workflows/cto-review.yml index 89fb40f..9b97c24 100644 --- a/.github/workflows/cto-review.yml +++ b/.github/workflows/cto-review.yml @@ -224,25 +224,22 @@ jobs: PY - name: Post PR review + # Always posts as COMMENT — not APPROVE/REQUEST_CHANGES — because the default + # GITHUB_TOKEN is not permitted to formally approve PRs without toggling a + # repo setting. The verdict is still prominent in the first line of the body + # ("## CTO Review — APPROVE|REQUEST_CHANGES|COMMENT"). Human merges, so the + # GitHub-native review state isn't load-bearing. if: steps.claude.outputs.skipped != '1' uses: actions/github-script@v7 - env: - VERDICT: ${{ steps.claude.outputs.verdict }} with: script: | const fs = require('fs'); const body = fs.readFileSync('/tmp/review-body.md', 'utf8'); - const verdict = process.env.VERDICT; - const eventMap = { - 'APPROVE': 'APPROVE', - 'REQUEST_CHANGES': 'REQUEST_CHANGES', - 'COMMENT': 'COMMENT' - }; await github.rest.pulls.createReview({ owner: context.repo.owner, repo: context.repo.repo, pull_number: context.issue.number, - event: eventMap[verdict] || 'COMMENT', + event: 'COMMENT', body, });