|
6 | 6 | types: [labeled] |
7 | 7 |
|
8 | 8 | permissions: |
9 | | - contents: read |
| 9 | + contents: write |
| 10 | + pull-requests: write |
10 | 11 | issues: read |
11 | 12 | id-token: write |
12 | 13 |
|
|
34 | 35 | - name: Install Claude Code CLI |
35 | 36 | run: npm install -g @anthropic-ai/claude-code |
36 | 37 |
|
| 38 | + # New commits need an author - Claude never has repo write access outside this job. |
| 39 | + - name: Configure git identity for Claude's commits |
| 40 | + run: | |
| 41 | + git config --global user.email "claude-bot@users.noreply.github.com" |
| 42 | + git config --global user.name "claude-bot" |
| 43 | +
|
37 | 44 | # ISSUE_NUMBER only - title/body are untrusted, so Claude fetches them itself via gh rather than us splicing them into this script. |
38 | 45 | - name: Write prompt |
39 | 46 | env: |
|
45 | 52 | 1. Run \`gh issue view $ISSUE_NUMBER\` to read the full issue (title, body, comments). |
46 | 53 | 2. Based on the description, actually try to reproduce the reported problem using this repository's existing code and test tooling - write and run a small script or test case that exercises the described behavior, don't just reason about whether it would fail. |
47 | 54 | 3. If you reproduce it, identify the root cause in the source code. |
48 | | - 4. If you cannot reproduce it, explain exactly what you tried, why it didn't reproduce, and what additional information (exact repro steps, versions, environment) would help. |
49 | | - 5. Do not commit, push, open a PR, or comment on the issue - your only output is the report file below. |
50 | | - 6. Write your findings to investigation-report.md in the repository root: a summary, the exact reproduction steps you tried, whether it reproduced, your root-cause diagnosis if found, and a suggested fix approach if you have one. |
| 55 | + 4. If you can reproduce it and you're confident the fix is small, narrow, and clearly correct, implement it, create a new branch off master named \`fix/issue-$ISSUE_NUMBER\`, commit, push it, and open a pull request against master with \`gh pr create\` that includes "Fixes #$ISSUE_NUMBER" in the body. If the right fix is unclear, would need broader changes, or you're not confident it's correct, do not open a PR - note that in the report instead. |
| 56 | + 5. If you cannot reproduce it, explain exactly what you tried, why it didn't reproduce, and what additional information (exact repro steps, versions, environment) would help. |
| 57 | + 6. Do not comment on the issue itself. |
| 58 | + 7. Always write your findings to investigation-report.md in the repository root: a summary, the exact reproduction steps you tried, whether it reproduced, your root-cause diagnosis if found, and whether you opened a fix PR (with its number) or why you decided not to. |
51 | 59 | EOF |
52 | 60 |
|
53 | 61 | - name: Investigate with Claude |
|
0 commit comments