|
| 1 | +name: Claude Bug Fixer |
| 2 | + |
| 3 | +on: |
| 4 | + issues: |
| 5 | + types: [labeled] |
| 6 | + |
| 7 | +jobs: |
| 8 | + claude-fix-bug: |
| 9 | + if: github.event.label.name == 'bug' |
| 10 | + runs-on: ubuntu-latest |
| 11 | + permissions: |
| 12 | + contents: write |
| 13 | + pull-requests: write |
| 14 | + issues: write |
| 15 | + id-token: write |
| 16 | + |
| 17 | + steps: |
| 18 | + - name: Checkout repository |
| 19 | + uses: actions/checkout@v4 |
| 20 | + with: |
| 21 | + fetch-depth: 0 |
| 22 | + |
| 23 | + - name: Run Claude Bug Fixer |
| 24 | + id: claude-bug-fixer |
| 25 | + uses: anthropics/claude-code-action@v1 |
| 26 | + with: |
| 27 | + anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} |
| 28 | + allowed_tools: 'Bash,Read,Write,Edit,Glob,Grep' |
| 29 | + prompt: | |
| 30 | + A bug has been reported in issue #${{ github.event.issue.number }}. |
| 31 | +
|
| 32 | + Issue title: ${{ github.event.issue.title }} |
| 33 | + Issue body: |
| 34 | + ${{ github.event.issue.body }} |
| 35 | +
|
| 36 | + Please do the following: |
| 37 | + 1. Analyze the issue carefully to understand the bug being reported. |
| 38 | + 2. Explore the codebase to find the relevant code that is likely causing the bug. |
| 39 | + 3. Implement a fix for the bug. |
| 40 | + 4. Create a new branch named `fix/issue-${{ github.event.issue.number }}` from main. |
| 41 | + 5. Commit your changes to that branch with a descriptive commit message. |
| 42 | + 6. Open a **draft** pull request targeting the main branch with: |
| 43 | + - A clear title summarizing the fix |
| 44 | + - A description explaining what the bug was and how you fixed it |
| 45 | + - `Fixes #${{ github.event.issue.number }}` in the PR body |
| 46 | +
|
| 47 | + Important guidelines: |
| 48 | + - Only change code that is directly related to fixing the reported bug. Do not refactor or make unrelated improvements. |
| 49 | + - If you cannot determine the root cause or the fix is too risky/complex, leave a comment on the issue explaining what you found and why an automated fix isn't appropriate. |
| 50 | + - Make sure the fix is complete and the code compiles/passes linting before opening the PR. |
0 commit comments