Skip to content

fix: make auto-review post (track_progress), trigger on ready, skip drafts#148

Open
amdove wants to merge 5 commits into
mainfrom
fix-review-triggers-and-tools
Open

fix: make auto-review post (track_progress), trigger on ready, skip drafts#148
amdove wants to merge 5 commits into
mainfrom
fix-review-triggers-and-tools

Conversation

@amdove

@amdove amdove commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Consolidated fixes so the auto-review actually runs and posts:

  • track_progress: "true" — the key fix. In automation mode claude-code-action runs the review but doesn't publish it without this; runs were completing with 0 denials but posting nothing. Mirrors the review-actions wrapper used by ptd-config.
  • Trigger on ready_for_review — previously only opened, so draft→ready did nothing.
  • Skip drafts — job guard !github.event.pull_request.draft, consolidated with the existing bot-author check into one job-level if.
  • Tool denylist instead of the narrow allowlist, so Claude can read .claude/review-guidelines.md and repo files (was hitting permission denials and bailing).

⚠️ Can't be verified on this PR (claude-code-action requires the workflow file to match the default branch); confirmation is on the next normal PR after merge.

amdove and others added 4 commits July 9, 2026 14:26
Two fixes so the auto-review actually runs and posts:
- Add ready_for_review to triggers so switching a draft PR to ready
  runs a review (previously only fired on opened).
- Add Read,Glob,Grep to --allowedTools. Without Read, Claude cannot
  open .claude/review-guidelines.md (referenced by the prompt), hits
  permission denials, and completes without posting any review.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace the narrow --allowedTools allowlist with a --disallowedTools
denylist. The allowlist omitted tools Claude needs (notably Read, to
open .claude/review-guidelines.md), causing permission denials and a
silent no-post. The denylist keeps claude-code-action's default tools
and blocks only mutation/shell/network. Mirrors the review-actions
config used by ptd-config, which posts reviews reliably.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Move the bot-author check to a job-level guard and add a draft guard so
reviews don't run on draft PRs. On ready_for_review the PR is no longer
draft, so the review still runs when a draft is marked ready.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
In automation mode (a prompt is supplied) claude-code-action runs the
review but does not publish it to the PR unless track_progress is true.
Runs were completing with 0 denials but posting nothing. This mirrors the
posit-dev/review-actions wrapper used by ptd-config, which sets
track_progress and posts reliably.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@amdove amdove changed the title fix: auto-review triggers on ready_for_review + can read guidelines fix: make auto-review post (track_progress), trigger on ready, skip drafts Jul 10, 2026
The mcp__github__create_pending_pull_request_review flow + Bash denylist
was not the documented way to post an automated review with the raw
action. Match examples/pr-review-comprehensive.yml:
- allowedTools: mcp__github_inline_comment__create_inline_comment +
  Bash(gh pr comment/diff/view) + Read/Glob/Grep (for the guidelines file)
- prompt: inline comments for line feedback, top-level gh pr comment for
  general notes, comment-only (no approve/deny)
- track_progress: true (required so automation-mode reviews post)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant