Conversation
Review Summary by QodoAdd Claude Code GitHub Actions workflows for automated 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 Actions Diagramflowchart LR
A["GitHub Events"] -->|PR opened/updated| B["claude-code-review.yml"]
A -->|@claude mention| C["claude.yml"]
B -->|triggers| D["Claude Code Review"]
C -->|triggers| E["Claude Code Assistant"]
D -->|creates comments| F["Pull Request"]
E -->|creates comments| F
File Changes1. .github/workflows/claude-code-review.yml
|
Code Review by Qodo
1. Untrusted triggers expose secret
|
| on: | ||
| issue_comment: | ||
| types: [created] | ||
| pull_request_review_comment: | ||
| types: [created] | ||
| issues: | ||
| types: [opened, assigned] | ||
| pull_request_review: | ||
| types: [submitted] | ||
|
|
||
| jobs: | ||
| claude: | ||
| 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 triggers expose secret 🐞 Bug ⛨ Security
claude.yml runs whenever @claude appears in an issue/PR comment or issue body/title, without checking author trust/association. Because it injects secrets.CLAUDE_CODE_OAUTH_TOKEN into a third-party action, any external user who can comment/open issues can trigger billable runs and potentially exfiltrate the token via the bot’s response.
Agent Prompt
### Issue description
`claude.yml` can be triggered by any commenter/issue author who includes `@claude`, but the workflow passes a sensitive secret (`CLAUDE_CODE_OAUTH_TOKEN`) into the action. This enables untrusted triggering (potential token exfiltration + cost abuse).
### Issue Context
The current `if:` only checks for `contains(..., '@claude')`. Add an allowlist check using `author_association` fields (e.g., `OWNER|MEMBER|COLLABORATOR`) for each event type, and/or require org/repo permission checks.
### Fix Focus Areas
- .github/workflows/claude.yml[14-19]
- .github/workflows/claude.yml[21-26]
- .github/workflows/claude.yml[33-37]
ⓘ 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!