Skip to content

Commit d315709

Browse files
committed
Add issues triage and deduplication jobs
Signed-off-by: Maksym Pavlenko <[email protected]>
1 parent ce02879 commit d315709

File tree

2 files changed

+138
-0
lines changed

2 files changed

+138
-0
lines changed

.github/workflows/dedup.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Issue Deduplication
2+
3+
on:
4+
issues:
5+
types: [opened]
6+
7+
jobs:
8+
deduplicate:
9+
runs-on: ubuntu-latest
10+
timeout-minutes: 10
11+
permissions:
12+
contents: read
13+
issues: write
14+
id-token: write
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v5
19+
with:
20+
fetch-depth: 1
21+
22+
- name: Check for duplicate issues
23+
uses: anthropics/claude-code-action@v1
24+
with:
25+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
26+
prompt: |
27+
Analyze this new issue and check if it's a duplicate of existing issues in the repository.
28+
29+
Issue: #${{ github.event.issue.number }}
30+
Repository: ${{ github.repository }}
31+
32+
Your task:
33+
1. Use mcp__github__get_issue to get details of the current issue (#${{ github.event.issue.number }})
34+
2. Search for similar existing issues using mcp__github__search_issues with relevant keywords from the issue title and body
35+
3. Compare the new issue with existing ones to identify potential duplicates
36+
37+
Criteria for duplicates:
38+
- Same bug or error being reported
39+
- Same feature request (even if worded differently)
40+
- Same question being asked
41+
- Issues describing the same root problem
42+
43+
If you find duplicates:
44+
- Add a comment on the new issue linking to the original issue(s)
45+
- Apply a "duplicate" label to the new issue
46+
- Be polite and explain why it's a duplicate
47+
- Suggest the user follow the original issue for updates
48+
49+
If it's NOT a duplicate:
50+
- Don't add any comments
51+
- You may apply appropriate topic labels based on the issue content
52+
53+
Use these tools:
54+
- mcp__github__get_issue: Get issue details
55+
- mcp__github__search_issues: Search for similar issues
56+
- mcp__github__list_issues: List recent issues if needed
57+
- mcp__github__create_issue_comment: Add a comment if duplicate found
58+
- mcp__github__update_issue: Add labels
59+
60+
Be thorough but efficient. Focus on finding true duplicates, not just similar issues.
61+
62+
claude_args: |
63+
--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"

.github/workflows/triage.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Issue Triage
2+
on:
3+
issues:
4+
types: [opened]
5+
6+
jobs:
7+
triage-issue:
8+
runs-on: ubuntu-latest
9+
timeout-minutes: 10
10+
permissions:
11+
contents: read
12+
issues: write
13+
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v5
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Triage issue with Claude
21+
uses: anthropics/claude-code-action@v1
22+
with:
23+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
24+
prompt: |
25+
You're an issue triage assistant for GitHub issues. Your task is to analyze the issue and select appropriate labels from the provided list.
26+
27+
IMPORTANT: Don't post any comments or messages to the issue. Your only action should be to apply labels.
28+
29+
Issue Information:
30+
- REPO: ${{ github.repository }}
31+
- ISSUE_NUMBER: ${{ github.event.issue.number }}
32+
33+
TASK OVERVIEW:
34+
35+
1. First, fetch the list of labels available in this repository by running: `gh label list`. Run exactly this command with nothing else.
36+
37+
2. Next, use the GitHub tools to get context about the issue:
38+
- You have access to these tools:
39+
- mcp__github__get_issue: Use this to retrieve the current issue's details including title, description, and existing labels
40+
- mcp__github__get_issue_comments: Use this to read any discussion or additional context provided in the comments
41+
- mcp__github__update_issue: Use this to apply labels to the issue (do not use this for commenting)
42+
- mcp__github__search_issues: Use this to find similar issues that might provide context for proper categorization and to identify potential duplicate issues
43+
- mcp__github__list_issues: Use this to understand patterns in how other issues are labeled
44+
- Start by using mcp__github__get_issue to get the issue details
45+
46+
3. Analyze the issue content, considering:
47+
- The issue title and description
48+
- The type of issue (bug report, feature request, question, etc.)
49+
- Technical areas mentioned
50+
- Severity or priority indicators
51+
- User impact
52+
- Components affected
53+
54+
4. Select appropriate labels from the available labels list provided above:
55+
- Choose labels that accurately reflect the issue's nature
56+
- Be specific but comprehensive
57+
- Select priority labels if you can determine urgency (high-priority, med-priority, or low-priority)
58+
- Consider platform labels (android, ios) if applicable
59+
- If you find similar issues using mcp__github__search_issues, consider using a "duplicate" label if appropriate. Only do so if the issue is a duplicate of another OPEN issue.
60+
61+
5. Apply the selected labels:
62+
- Use mcp__github__update_issue to apply your selected labels
63+
- DO NOT post any comments explaining your decision
64+
- DO NOT communicate directly with users
65+
- If no labels are clearly applicable, do not apply any labels
66+
67+
IMPORTANT GUIDELINES:
68+
- Be thorough in your analysis
69+
- Only select labels from the provided list above
70+
- DO NOT post any comments to the issue
71+
- Your ONLY action should be to apply labels using mcp__github__update_issue
72+
- It's okay to not add any labels if none are clearly applicable
73+
74+
claude_args: |
75+
--allowedTools "Bash(gh label list),mcp__github__get_issue,mcp__github__get_issue_comments,mcp__github__update_issue,mcp__github__search_issues,mcp__github__list_issues"

0 commit comments

Comments
 (0)