Skip to content

Commit fd46082

Browse files
feat: restore triage-issue and deduplicate-issue jobs
1 parent be21736 commit fd46082

File tree

1 file changed

+85
-0
lines changed

1 file changed

+85
-0
lines changed

.github/workflows/claude.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,88 @@ jobs:
3838
github_token: ${{ secrets.GITHUB_TOKEN }}
3939
additional_permissions: |
4040
actions: read
41+
42+
# Auto-label new issues
43+
triage-issue:
44+
if: github.event_name == 'issues' && github.event.action == 'opened'
45+
runs-on: ubuntu-latest
46+
timeout-minutes: 10
47+
permissions:
48+
contents: read
49+
issues: write
50+
id-token: write
51+
steps:
52+
- name: Checkout repository
53+
uses: actions/checkout@v4
54+
with:
55+
fetch-depth: 1
56+
57+
- name: Triage issue with Claude
58+
uses: anthropics/claude-code-action@v1
59+
with:
60+
prompt: "/label-issue REPO: ${{ github.repository }} ISSUE_NUMBER: ${{ github.event.issue.number }}"
61+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
62+
github_token: ${{ secrets.GITHUB_TOKEN }}
63+
allowed_non_write_users: "*"
64+
claude_args: |
65+
--model claude-haiku-4-5-20251001
66+
67+
# Check new issues for duplicates
68+
deduplicate-issue:
69+
if: github.event_name == 'issues' && github.event.action == 'opened'
70+
runs-on: ubuntu-latest
71+
timeout-minutes: 10
72+
permissions:
73+
contents: read
74+
issues: write
75+
id-token: write
76+
steps:
77+
- name: Checkout repository
78+
uses: actions/checkout@v4
79+
with:
80+
fetch-depth: 1
81+
82+
- name: Check for duplicate issues
83+
uses: anthropics/claude-code-action@v1
84+
with:
85+
prompt: |
86+
Analyze this new issue and check if it's a duplicate of existing issues in the repository.
87+
88+
Issue: #${{ github.event.issue.number }}
89+
Repository: ${{ github.repository }}
90+
91+
Your task:
92+
1. Use mcp__github__get_issue to get details of the current issue (#${{ github.event.issue.number }})
93+
2. Search for similar existing issues using mcp__github__search_issues with relevant keywords from the issue title and body
94+
3. Compare the new issue with existing ones to identify potential duplicates
95+
96+
Criteria for duplicates:
97+
- Same bug or error being reported
98+
- Same feature request (even if worded differently)
99+
- Same question being asked
100+
- Issues describing the same root problem
101+
102+
If you find duplicates:
103+
- Add a comment on the new issue linking to the original issue(s)
104+
- Apply a "duplicate" label to the new issue
105+
- Be polite and explain why it's a duplicate
106+
- Suggest the user follow the original issue for updates
107+
108+
If it is NOT a duplicate:
109+
- Do not add any comments
110+
- Do not add any labels (the triage job handles labeling)
111+
112+
Use these tools:
113+
- mcp__github__get_issue: Get issue details
114+
- mcp__github__search_issues: Search for similar issues
115+
- mcp__github__list_issues: List recent issues if needed
116+
- mcp__github__create_issue_comment: Add a comment if duplicate found
117+
- mcp__github__update_issue: Add labels
118+
119+
Be thorough but efficient. Focus on finding true duplicates, not just similar issues.
120+
121+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
122+
github_token: ${{ secrets.GITHUB_TOKEN }}
123+
allowed_non_write_users: "*"
124+
claude_args: |
125+
--model claude-haiku-4-5-20251001 --allowedTools "mcp__github__get_issue,mcp__github__search_issues,mcp__github__list_issues,mcp__github__create_issue_comment,mcp__github__update_issue,mcp__github__get_issue_comments"

0 commit comments

Comments
 (0)