Skip to content

Claude review - #238

Closed
CassNot wants to merge 10 commits into
merlinquantum:mainfrom
CassNot:claude-review
Closed

Claude review#238
CassNot wants to merge 10 commits into
merlinquantum:mainfrom
CassNot:claude-review

Conversation

@CassNot

@CassNot CassNot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR introduces a new GitHub Actions workflow that enables Claude to provide automated code reviews on pull requests, with security controls to restrict access to organization members.
Features

  • On-demand code reviews: Members can request Claude reviews by commenting @claude on PRs, issues, or review comments
  • Manual trigger option: Alternatively, trigger reviews manually via GitHub Actions > Claude Code > Run workflow
  • Organization member verification: Workflow automatically verifies that the requesting user is an organization member before running
  • Comments-only access: Claude has read-only access to code and can post review comments but cannot make direct modifications
  • CI-aware reviews: Claude can read CI results to provide context-aware feedback

Type of change

  • Bug fix
  • New feature
  • Documentation update
  • Refactor / Cleanup
  • Performance improvement
  • CI / Build / Tooling
  • Breaking change (requires migration notes)

Proposed changes

How to Use
Automatic trigger: simply comment @claude anywhere on a PR, and the workflow will automatically trigger.

Manual trigger:

  • Go to Actions → Claude Code
  • Click Run workflow
  • Claude will review the current PR

Permissions

  • contents: read — Read-only access to code and tests
  • pull-requests: write — Can post comments and reviews
  • id-token: write — Authentication with Anthropic API
  • actions: read — Access to CI results

Security

  • Membership check ensures only organization members can trigger reviews
  • No write access to code (comments only)
  • Supports ANTHROPIC_API_KEY secret for API authentication

@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: 2a9b97366b

ℹ️ 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 +29 to +32
await github.rest.orgs.checkMembershipForUser({
org: context.repo.owner,
username: context.actor
});

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 Use a token that can read org membership

This membership gate calls orgs.checkMembershipForUser with the default GITHUB_TOKEN, but this job only grants contents: read. GitHub's org-membership endpoint requires the token to have the organization Members read permission to reliably check private org memberships; otherwise valid org members whose membership is private are reported as not found/unauthorized and Claude is skipped. Use a PAT/GitHub App token with org member read access, or switch to a repository-permission check that the workflow token can perform.

Useful? React with 👍 / 👎.

Comment on lines +3 to +8
on:
workflow_dispatch:
pull_request_review_comment:
types: [created]
pull_request_review:
types: [submitted]

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 Add the missing PR comment trigger

The workflow condition handles github.event_name == 'issue_comment', which is the event fired for normal PR conversation comments such as @claude please review, but issue_comment is not listed under on:. As a result, those comments never start this workflow; only inline review comments or submitted reviews do. Add issue_comment: { types: [created] } here if PR comment mentions are meant to invoke Claude.

Useful? React with 👍 / 👎.

@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: 31185b4dca

ℹ️ 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".

name: Claude Code

on:
workflow_dispatch:

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 Provide a prompt for manual dispatches

When this workflow is started with workflow_dispatch, the event has no comment/review payload containing @claude, and this step does not pass a prompt input to anthropics/claude-code-action@v1. I checked the action's v1 trigger validation: without an explicit prompt it only proceeds when a supported GitHub event payload contains the trigger phrase, so manually running the workflow will pass the membership gate but Claude will have no trigger/PR instruction to review. Add dispatch inputs and pass a prompt that includes the target PR, or remove the manual trigger.

Useful? React with 👍 / 👎.

@CassNot

CassNot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

@claude

@CassNot

CassNot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

@claude review

@CassNot

CassNot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

@claude review

@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: 05379fd4df

ℹ️ 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".

runs-on: ubuntu-latest
permissions:
contents: read # Read-only access to code
pull-requests: write # Can post comments/reviews on PRs

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 Grant issues write for issue-comment triggers

When this workflow is triggered from an issue_comment on a plain issue, the Claude job runs but its GITHUB_TOKEN has no Issues scope because GitHub sets any omitted permission to none, and GitHub documents issues: write as the scope that permits adding issue comments. The new trigger is not limited to PR comments (github.event.issue.pull_request), so @claude on an issue will pass the membership gate and then be unable to read/update/comment on the issue unless you add issues: write or filter out non-PR issue comments.

Useful? React with 👍 / 👎.

@CassNot CassNot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

test

@@ -0,0 +1,89 @@
name: Claude Code

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@claude review

@CassNot CassNot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

test with node js version

- name: Create GitHub App token
id: app-token
uses: actions/create-github-app-token@v2
with:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@claude review

@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: 59faf01160

ℹ️ 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".

contents: read # Read-only access to code
pull-requests: write # Can post comments/reviews on PRs
id-token: write # Required for authentication
actions: read # Required for Claude to read CI results on PRs

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 Pass actions access to Claude

Granting actions: read on the job does not by itself enable Claude Code's CI tools; the v1 action also requires additional_permissions: | actions: read in its with: inputs. In this configuration, requests like @claude why did CI fail? will run with the token scope but Claude won't receive the Actions MCP permission the workflow comments claim to provide.

Useful? React with 👍 / 👎.

Comment on lines +66 to +68
uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}

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 Align the action gate with org membership

The workflow now allows any org member through this custom membership gate, but anthropics/claude-code-action@v1 still enforces its own default trigger policy that only permits users with repository write access unless allowed_non_write_users is configured with a github_token. For org members who do not have write access to this repo, the membership job succeeds but the Claude step rejects the request, so the advertised org-member access does not work for that case.

Useful? React with 👍 / 👎.

@CassNot CassNot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Test 3

Comment thread .github/workflows/claude.yml Outdated

@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: 7af914fa30

ℹ️ 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 thread .github/workflows/claude.yml Outdated

@CassNot CassNot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Test 4 with fixed input names

Comment thread .github/workflows/claude.yml

@CassNot CassNot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

test 5

}

claude:
needs: check-membership

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@claude review

@CassNot CassNot closed this Jun 10, 2026
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