From 20a849746ca23ce75e345aa804db01baa74a62e5 Mon Sep 17 00:00:00 2001 From: fullstackjam Date: Sun, 2 Aug 2026 13:56:02 +0800 Subject: [PATCH] ci: quote the review bot's allowed-tools value MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The claude-review job has never been able to post. On PR #163 it ran three times, each ending in permission denials and "No buffered inline comments" — 7, then 10, then silence — so no PR in this repo has had a bot review despite the workflow being wired up. claude_args is parsed with a shell-style splitter (the action ships base-action/test/parse-shell-args.test.ts, which covers both quote styles). Unquoted, `Bash(gh pr diff:*)` splits on its spaces. PR #163's run log shows the resulting allowlist: "mcp__github_inline_comment__create_inline_comment", "Bash(gh", "pr", "diff:*)", "view:*)", "comment:*)" None of those match a real permission, so every `gh pr diff/view/comment` call hit the gate and the buffered review was dropped. Double-quoting the value keeps it a single token. Verified with shlex.split, which is the same splitting model: '--allowed-tools' 'mcp__github_inline_comment__create_inline_comment,Bash(gh pr diff:*),...' This PR is its own test: if the fix works, the bot posts a review here. --- .github/workflows/claude-code-review.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/claude-code-review.yml b/.github/workflows/claude-code-review.yml index ffa6666..71f5742 100644 --- a/.github/workflows/claude-code-review.yml +++ b/.github/workflows/claude-code-review.yml @@ -48,7 +48,13 @@ jobs: # it: with pull-requests:read it never reaches the tool (0 denials); # with write it tries and hits the permission gate (1 denial, "No # buffered inline comments"). The gh commands let it read diff/context. - claude_args: '--allowed-tools mcp__github_inline_comment__create_inline_comment,Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr comment:*)' + # + # The value MUST stay double-quoted. claude_args is parsed with a + # shell-style splitter, so an unquoted `Bash(gh pr diff:*)` splits on + # its spaces: PR #163's run logged the allowlist as "Bash(gh", "pr", + # "diff:*)", "view:*)", "comment:*)" — every gh command then hit the + # permission gate (10 denials) and the review was silently dropped. + claude_args: '--allowed-tools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr comment:*)"' # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md # or https://code.claude.com/docs/en/cli-reference for available options