Conversation
Review Summary by QodoAdd Claude Code GitHub Actions workflows for AI-assisted reviews
WalkthroughsDescription• Adds two GitHub Actions workflows for Claude Code integration • Enables automated code reviews on pull request events • Allows Claude AI assistance via @claude mentions in comments • Configures secure OAuth token authentication with GitHub Diagramflowchart LR
A["GitHub Events"] -->|PR opened/updated| B["claude-code-review.yml"]
A -->|@claude mention| C["claude.yml"]
B -->|Runs| D["Claude Code Review"]
C -->|Runs| E["Claude Code Assistant"]
D -->|Creates| F["Review Comments"]
E -->|Creates| F
File Changes1. .github/workflows/claude-code-review.yml
|
Code Review by Qodo
1. Untrusted trigger runs with secret
|
| if: | | ||
| (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) || | ||
| (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) || | ||
| (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) || | ||
| (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude'))) | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| pull-requests: read | ||
| issues: read | ||
| id-token: write | ||
| actions: read # Required for Claude to read CI results on PRs | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 1 | ||
|
|
||
| - name: Run Claude Code | ||
| id: claude | ||
| uses: anthropics/claude-code-action@v1 | ||
| with: | ||
| claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} | ||
|
|
There was a problem hiding this comment.
1. Untrusted trigger runs with secret 🐞 Bug ⛨ Security
The claude job runs for any issue/comment/review that contains @claude without verifying the actor is trusted. Because it passes secrets.CLAUDE_CODE_OAUTH_TOKEN into a third-party action, any user able to create an issue/comment can trigger secret-backed executions.
Agent Prompt
## Issue description
The workflow runs on `@claude` mentions from multiple public-facing events but does not restrict execution to trusted actors, while still passing a repository secret into a third-party action.
## Issue Context
This is a classic “untrusted trigger + secrets” GitHub Actions pattern. The workflow should hard-gate execution based on the event author’s trust level (e.g., `author_association`), or via an explicit allowlist.
## Fix Focus Areas
- .github/workflows/claude.yml[14-38]
### Concrete changes to implement
- Extend the job `if:` to require a trusted `author_association` for each supported event payload, e.g. allow only `OWNER`, `MEMBER`, `COLLABORATOR`.
- For `issue_comment` / `pull_request_review_comment`: use `github.event.comment.author_association`.
- For `pull_request_review`: use `github.event.review.author_association`.
- For `issues`: use `github.event.issue.author_association`.
- Optionally add an explicit allowlist of `github.actor` for maximum control.
- Keep the `@claude` contains-check, but AND it with the trust check so untrusted mentions do not execute the job.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
🤖 Installing Claude Code GitHub App
This PR adds a GitHub Actions workflow that enables Claude Code integration in our repository.
What is Claude Code?
Claude Code is an AI coding agent that can help with:
How it works
Once this PR is merged, we'll be able to interact with Claude by mentioning @claude in a pull request or issue comment.
Once the workflow is triggered, Claude will analyze the comment and surrounding context, and execute on the request in a GitHub action.
Important Notes
Security
There's more information in the Claude Code action repo.
After merging this PR, let's try mentioning @claude in a comment on any PR to get started!