Claude Code Integration #5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Claude Code Integration | |
| on: | |
| issue_comment: | |
| types: [created] | |
| pull_request_review_comment: | |
| types: [created] | |
| jobs: | |
| # Handle PR comments | |
| process-pr-review: | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event_name == 'issue_comment' && github.event.issue.pull_request && startsWith(github.event.comment.body, 'claude:') }} | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| issues: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Get PR details | |
| id: pr | |
| run: | | |
| PR_NUMBER="${{ github.event.issue.number }}" | |
| FEEDBACK="${{ github.event.comment.body }}" | |
| # Remove the "claude:" prefix | |
| FEEDBACK="${FEEDBACK#claude:}" | |
| echo "number=$PR_NUMBER" >> $GITHUB_OUTPUT | |
| echo "feedback=$FEEDBACK" >> $GITHUB_OUTPUT | |
| - name: Process with Claude Code | |
| uses: fractureinc/claude-code-github-action@v0.2.2 | |
| with: | |
| mode: 'review' | |
| pr-number: ${{ steps.pr.outputs.number }} | |
| feedback: ${{ steps.pr.outputs.feedback }} | |
| anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }} | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| process-pr-suggestions: | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event_name == 'issue_comment' && github.event.issue.pull_request && startsWith(github.event.comment.body, 'claude-suggest:') }} | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| issues: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Get PR details | |
| id: pr | |
| run: | | |
| PR_NUMBER="${{ github.event.issue.number }}" | |
| FEEDBACK="${{ github.event.comment.body }}" | |
| # Remove the "claude-suggest:" prefix | |
| FEEDBACK="${FEEDBACK#claude-suggest:}" | |
| echo "number=$PR_NUMBER" >> $GITHUB_OUTPUT | |
| echo "feedback=$FEEDBACK" >> $GITHUB_OUTPUT | |
| - name: Process with Claude Code Suggestions | |
| uses: fractureinc/claude-code-github-action@v0.2.2 | |
| with: | |
| mode: 'suggest' | |
| pr-number: ${{ steps.pr.outputs.number }} | |
| feedback: ${{ steps.pr.outputs.feedback }} | |
| anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }} | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| # Handle code review comments | |
| process-review-comment: | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event_name == 'pull_request_review_comment' && startsWith(github.event.comment.body, 'claude:') }} | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| issues: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Get PR and comment details | |
| id: details | |
| run: | | |
| PR_NUMBER="${{ github.event.pull_request.number }}" | |
| FEEDBACK="${{ github.event.comment.body }}" | |
| # Remove the "claude:" prefix | |
| FEEDBACK="${FEEDBACK#claude:}" | |
| COMMENT_ID="${{ github.event.comment.id }}" | |
| FILE_PATH="${{ github.event.comment.path }}" | |
| LINE="${{ github.event.comment.line }}" | |
| echo "number=$PR_NUMBER" >> $GITHUB_OUTPUT | |
| echo "feedback=$FEEDBACK" >> $GITHUB_OUTPUT | |
| echo "comment_id=$COMMENT_ID" >> $GITHUB_OUTPUT | |
| echo "file_path=$FILE_PATH" >> $GITHUB_OUTPUT | |
| echo "line=$LINE" >> $GITHUB_OUTPUT | |
| - name: Process with Claude Code for code review comment | |
| uses: fractureinc/claude-code-github-action@v0.2.2 | |
| with: | |
| mode: 'review' | |
| pr-number: ${{ steps.details.outputs.number }} | |
| feedback: ${{ steps.details.outputs.feedback }} | |
| anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }} | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| process-suggest-review-comment: | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event_name == 'pull_request_review_comment' && startsWith(github.event.comment.body, 'claude-suggest:') }} | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| issues: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Get PR and comment details | |
| id: details | |
| run: | | |
| PR_NUMBER="${{ github.event.pull_request.number }}" | |
| FEEDBACK="${{ github.event.comment.body }}" | |
| # Remove the "claude-suggest:" prefix | |
| FEEDBACK="${FEEDBACK#claude-suggest:}" | |
| COMMENT_ID="${{ github.event.comment.id }}" | |
| FILE_PATH="${{ github.event.comment.path }}" | |
| LINE="${{ github.event.comment.line }}" | |
| echo "number=$PR_NUMBER" >> $GITHUB_OUTPUT | |
| echo "feedback=$FEEDBACK" >> $GITHUB_OUTPUT | |
| echo "comment_id=$COMMENT_ID" >> $GITHUB_OUTPUT | |
| echo "file_path=$FILE_PATH" >> $GITHUB_OUTPUT | |
| echo "line=$LINE" >> $GITHUB_OUTPUT | |
| - name: Process with Claude Code Suggestions for code review | |
| uses: fractureinc/claude-code-github-action@v0.2.2 | |
| with: | |
| mode: 'suggest-review' | |
| pr-number: ${{ steps.details.outputs.number }} | |
| feedback: ${{ steps.details.outputs.feedback }} | |
| file-path: ${{ steps.details.outputs.file_path }} | |
| line-number: ${{ steps.details.outputs.line }} | |
| comment-id: ${{ steps.details.outputs.comment_id }} | |
| strict-mode: 'true' | |
| anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }} | |
| github-token: ${{ secrets.GITHUB_TOKEN }} |