Skip to content

ci: let PR comments trigger a Claude review reconcile round - #166

Merged
Troublor merged 1 commit into
mainfrom
william/ci/pr-review-comment-trigger
Jul 31, 2026
Merged

ci: let PR comments trigger a Claude review reconcile round#166
Troublor merged 1 commit into
mainfrom
william/ci/pr-review-comment-trigger

Conversation

@Troublor

Copy link
Copy Markdown
Collaborator

Summary

Extends the Claude pr-review job in .github/workflows/claude.yml to support issue_comment-triggered reconciliation of open review questions/findings, using the shared claude-pr-review action's new support for this (see megaeth-labs/.github#8).

The on: block already delivers issue_comment: [created]; this change wires those events into the pr-review job. Three changes, everything else preserved:

  1. if: — the existing pull_request condition is kept verbatim (wrapped in parens) and OR'd with an issue_comment branch that only fires on PR comments and skips the bot's own comments (mega-maxwell[bot]).
  2. Concurrency group — falls back to github.event.issue.number when github.event.pull_request.number is absent (comment events), so a comment-triggered run serializes against the same PR.
  3. Checkout — checks out refs/pull/<n>/head when triggered by a comment, so the review runs against the PR head.

No other job and the on: block are unchanged.

🤖 Generated with Claude Code

Extend the pr-review job to run on issue_comment events on PRs so the
shared claude-pr-review action can reconcile open review questions and
findings. Skips the bot's own comments, keys concurrency off the issue
number, and checks out the PR head when triggered by a comment.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GCc8MLBBAp5jAxc2x19swa
@mega-maxwell

mega-maxwell Bot commented Jul 31, 2026

Copy link
Copy Markdown

Claude review status

Living comment — rewritten in place. The review workflow keeps this single comment up to date instead of posting a new one each round, so it always describes the latest reviewed commit and the earlier text is intentionally gone. No reply is needed here; reply to a finding in its own review thread, and answer an open question in a reply on this PR. The next review round reconciles your answer.

🛠️ Review did not finish

Attempted head d1487c1f · updated 2026-07-31T05:44:24+00:00

This round did not publish: MODEL_ACTION_FAILED in phase review_retry. Anything listed below is from the last round that did. Re-run the workflow or push a new commit to try again.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d1487c1f6c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +65 to +67
(github.event_name == 'issue_comment' &&
github.event.issue.pull_request != null &&
github.event.comment.user.login != 'mega-maxwell[bot]')

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep fork code out of the privileged comment workflow

For a comment on a fork-based PR, issue_comment runs the trusted default-branch workflow with repository secrets available, and this condition lets any commenter trigger the job; the subsequent checkout loads the fork's mutable PR head before invoking Claude with both the OAuth secret and a repository installation token. A fork author can therefore place hostile agent instructions in the branch and post an ordinary comment to make the privileged agent process them, bypassing the secret withholding that protects normal pull_request runs from forks. Gate this path on a trusted author association, or run fork reconciliation without privileged credentials and write access.

Useful? React with 👍 / 👎.

Comment on lines +65 to +67
(github.event_name == 'issue_comment' &&
github.event.issue.pull_request != null &&
github.event.comment.user.login != 'mega-maxwell[bot]')

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Route @claude comments to only one Claude job

When a member, collaborator, or owner posts a top-level PR comment containing @claude, it satisfies both the existing interactive condition and this new unconditional PR-comment branch. The jobs have no shared concurrency, and the interactive job has contents: write, so a request that edits the branch can race with pr-review checking out and reviewing the old head, producing stale findings in addition to running two paid agents for one comment. Exclude interactive-command comments from this branch, or serialize the review after the interactive job.

Useful? React with 👍 / 👎.

@Troublor
Troublor merged commit a1d62d0 into main Jul 31, 2026
27 of 29 checks passed
@Troublor
Troublor deleted the william/ci/pr-review-comment-trigger branch July 31, 2026 10:14
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.

2 participants