Claude review - #238
Conversation
There was a problem hiding this comment.
💡 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".
| await github.rest.orgs.checkMembershipForUser({ | ||
| org: context.repo.owner, | ||
| username: context.actor | ||
| }); |
There was a problem hiding this comment.
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 👍 / 👎.
| on: | ||
| workflow_dispatch: | ||
| pull_request_review_comment: | ||
| types: [created] | ||
| pull_request_review: | ||
| types: [submitted] |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
💡 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: |
There was a problem hiding this comment.
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 👍 / 👎.
|
@claude review |
|
@claude review |
There was a problem hiding this comment.
💡 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 |
There was a problem hiding this comment.
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 👍 / 👎.
| @@ -0,0 +1,89 @@ | |||
| name: Claude Code | |||
CassNot
left a comment
There was a problem hiding this comment.
test with node js version
| - name: Create GitHub App token | ||
| id: app-token | ||
| uses: actions/create-github-app-token@v2 | ||
| with: |
There was a problem hiding this comment.
💡 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 |
There was a problem hiding this comment.
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 👍 / 👎.
| uses: anthropics/claude-code-action@v1 | ||
| with: | ||
| anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
💡 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".
CassNot
left a comment
There was a problem hiding this comment.
Test 4 with fixed input names
| } | ||
|
|
||
| claude: | ||
| needs: check-membership |
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
Type of change
Proposed changes
How to Use
Automatic trigger: simply comment @claude anywhere on a PR, and the workflow will automatically trigger.
Manual trigger:
Permissions
Security