|
| 1 | +name: Claude Code |
| 2 | + |
| 3 | +on: |
| 4 | + issue_comment: |
| 5 | + types: [created] |
| 6 | + pull_request_review_comment: |
| 7 | + types: [created] |
| 8 | + issues: |
| 9 | + types: [opened, assigned] |
| 10 | + pull_request_review: |
| 11 | + types: [submitted] |
| 12 | + pull_request: |
| 13 | + types: [opened, synchronize] |
| 14 | + |
| 15 | +jobs: |
| 16 | + claude-interactive: |
| 17 | + if: | |
| 18 | + (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) || |
| 19 | + (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) || |
| 20 | + (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) || |
| 21 | + (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude'))) |
| 22 | + runs-on: ubuntu-latest |
| 23 | + permissions: |
| 24 | + contents: write |
| 25 | + pull-requests: write |
| 26 | + issues: write |
| 27 | + id-token: write |
| 28 | + actions: read |
| 29 | + steps: |
| 30 | + - name: Checkout repository |
| 31 | + uses: actions/checkout@v4 |
| 32 | + with: |
| 33 | + fetch-depth: 1 |
| 34 | + |
| 35 | + - name: Run Claude Code |
| 36 | + uses: anthropics/claude-code-action@v1 |
| 37 | + with: |
| 38 | + claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} |
| 39 | + |
| 40 | + claude-auto-review: |
| 41 | + if: github.event_name == 'pull_request' |
| 42 | + runs-on: ubuntu-latest |
| 43 | + permissions: |
| 44 | + contents: read |
| 45 | + pull-requests: write |
| 46 | + id-token: write |
| 47 | + steps: |
| 48 | + - name: Checkout repository |
| 49 | + uses: actions/checkout@v4 |
| 50 | + with: |
| 51 | + fetch-depth: 1 |
| 52 | + |
| 53 | + - name: Run Claude Code Review |
| 54 | + uses: anthropics/claude-code-action@v1 |
| 55 | + with: |
| 56 | + claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} |
| 57 | + prompt: | |
| 58 | + Please review this pull request for: |
| 59 | + - Code quality and Python best practices |
| 60 | + - Potential bugs or issues |
| 61 | + - Test coverage |
| 62 | + - Type hint correctness |
| 63 | +
|
| 64 | + Use inline comments for specific issues and a summary comment for overall feedback. |
| 65 | + claude_args: | |
| 66 | + --allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*)" |
0 commit comments