|
| 1 | +name: Claude Issue Triage |
| 2 | + |
| 3 | +on: |
| 4 | + issues: |
| 5 | + types: [opened] |
| 6 | + |
| 7 | +jobs: |
| 8 | + triage: |
| 9 | + runs-on: ubuntu-latest |
| 10 | + permissions: |
| 11 | + contents: read |
| 12 | + issues: write |
| 13 | + |
| 14 | + steps: |
| 15 | + - name: Checkout repository |
| 16 | + uses: actions/checkout@v4 |
| 17 | + with: |
| 18 | + fetch-depth: 1 |
| 19 | + |
| 20 | + - name: Run Claude Issue Triage |
| 21 | + id: claude-triage |
| 22 | + uses: anthropics/claude-code-action@v1 |
| 23 | + with: |
| 24 | + anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} |
| 25 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 26 | + allowed_non_write_users: '*' |
| 27 | + prompt: | |
| 28 | + REPO: ${{ github.repository }} |
| 29 | + ISSUE NUMBER: ${{ github.event.issue.number }} |
| 30 | + TITLE: ${{ github.event.issue.title }} |
| 31 | + BODY: ${{ github.event.issue.body }} |
| 32 | + AUTHOR: ${{ github.event.issue.user.login }} |
| 33 | +
|
| 34 | + Analyze this new issue and perform the following: |
| 35 | +
|
| 36 | + 1. **Categorize the issue type using ONLY these labels:** |
| 37 | + - bug: Something isn't working |
| 38 | + - enhancement: New feature or request |
| 39 | + - question: Further information is requested |
| 40 | + - documentation: Improvements or additions to documentation |
| 41 | + - good first issue: Good for newcomers (if issue is well-defined and small scope) |
| 42 | + - help wanted: Extra attention is needed (if issue needs community input) |
| 43 | + - backlog: Tracked for the future, but not currently planned or prioritized |
| 44 | +
|
| 45 | + 2. **Check for duplicates:** |
| 46 | + Search for similar existing issues using: |
| 47 | + `gh issue list --state all --search "<key terms from title/body>"` |
| 48 | +
|
| 49 | + If a duplicate exists: |
| 50 | + - Add the "duplicate" label |
| 51 | + - Comment mentioning the original issue number |
| 52 | +
|
| 53 | + 3. **Check for invalid issues:** |
| 54 | + If the issue lacks sufficient information, is spam, or doesn't make sense: |
| 55 | + - Add the "invalid" label |
| 56 | + - Comment asking for clarification or explaining why it's invalid |
| 57 | +
|
| 58 | + 4. **Apply labels:** |
| 59 | + Based on your analysis, add appropriate labels using: |
| 60 | + `gh issue edit ${{ github.event.issue.number }} --add-label "label1,label2"` |
| 61 | +
|
| 62 | + You may apply multiple labels if appropriate (e.g., "bug,help wanted"). |
| 63 | +
|
| 64 | + 5. **Add a brief comment** summarizing your triage decision to help maintainers. |
| 65 | +
|
| 66 | + claude_args: | |
| 67 | + --model claude-3-5-haiku-20241022 |
| 68 | + --allowedTools "Bash(gh issue:*),Bash(gh search:*)" |
0 commit comments