Skip to content

Commit 894f7e4

Browse files
authored
Merge branch 'anthropics:main' into main
2 parents d536820 + 74cc597 commit 894f7e4

File tree

5 files changed

+172
-124
lines changed

5 files changed

+172
-124
lines changed

.github/workflows/claude-dedupe-issues.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,19 @@ jobs:
1717
permissions:
1818
contents: read
1919
issues: write
20+
id-token: write
2021

2122
steps:
2223
- name: Checkout repository
2324
uses: actions/checkout@v4
2425

2526
- name: Run Claude Code slash command
26-
uses: anthropics/claude-code-base-action@v1
27+
uses: anthropics/claude-code-action@v1
2728
env:
2829
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2930
with:
31+
github_token: ${{ secrets.GITHUB_TOKEN }}
32+
allowed_non_write_users: "*"
3033
prompt: "/dedupe ${{ github.repository }}/issues/${{ github.event.issue.number || inputs.issue_number }}"
3134
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
3235
claude_args: "--model claude-sonnet-4-5-20250929"

.github/workflows/claude-issue-triage.yml

Lines changed: 53 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -11,65 +11,12 @@ jobs:
1111
permissions:
1212
contents: read
1313
issues: write
14+
id-token: write
1415

1516
steps:
1617
- name: Checkout repository
1718
uses: actions/checkout@v4
1819

19-
- name: Create triage prompt
20-
run: |
21-
mkdir -p /tmp/claude-prompts
22-
cat > /tmp/claude-prompts/triage-prompt.txt << 'EOF'
23-
You're an issue triage assistant for GitHub issues. Your task is to analyze the issue and select appropriate labels from the provided list.
24-
25-
IMPORTANT: Don't post any comments or messages to the issue. Your only action should be to apply labels.
26-
27-
Issue Information:
28-
- REPO: ${{ github.repository }}
29-
- ISSUE_NUMBER: ${{ github.event.issue.number }}
30-
31-
TASK OVERVIEW:
32-
33-
1. First, fetch the list of labels available in this repository by running: `gh label list`. Run exactly this command with nothing else.
34-
35-
2. Next, use the GitHub tools to get context about the issue:
36-
- You have access to these tools:
37-
- mcp__github__get_issue: Use this to retrieve the current issue's details including title, description, and existing labels
38-
- mcp__github__get_issue_comments: Use this to read any discussion or additional context provided in the comments
39-
- mcp__github__update_issue: Use this to apply labels to the issue (do not use this for commenting)
40-
- mcp__github__search_issues: Use this to find similar issues that might provide context for proper categorization and to identify potential duplicate issues
41-
- mcp__github__list_issues: Use this to understand patterns in how other issues are labeled
42-
- Start by using mcp__github__get_issue to get the issue details
43-
44-
3. Analyze the issue content, considering:
45-
- The issue title and description
46-
- The type of issue (bug report, feature request, question, etc.)
47-
- Technical areas mentioned
48-
- Severity or priority indicators
49-
- User impact
50-
- Components affected
51-
52-
4. Select appropriate labels from the available labels list provided above:
53-
- Choose labels that accurately reflect the issue's nature
54-
- Be specific but comprehensive
55-
- Select priority labels if you can determine urgency (high-priority, med-priority, or low-priority)
56-
- Consider platform labels (android, ios) if applicable
57-
- 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.
58-
59-
5. Apply the selected labels:
60-
- Use mcp__github__update_issue to apply your selected labels
61-
- DO NOT post any comments explaining your decision
62-
- DO NOT communicate directly with users
63-
- If no labels are clearly applicable, do not apply any labels
64-
65-
IMPORTANT GUIDELINES:
66-
- Be thorough in your analysis
67-
- Only select labels from the provided list above
68-
- DO NOT post any comments to the issue
69-
- Your ONLY action should be to apply labels using mcp__github__update_issue
70-
- It's okay to not add any labels if none are clearly applicable
71-
EOF
72-
7320
- name: Setup GitHub MCP Server
7421
run: |
7522
mkdir -p /tmp/mcp-config
@@ -96,11 +43,61 @@ jobs:
9643
9744
- name: Run Claude Code for Issue Triage
9845
timeout-minutes: 5
99-
uses: anthropics/claude-code-base-action@v1
46+
uses: anthropics/claude-code-action@v1
10047
env:
10148
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10249
with:
103-
prompt_file: /tmp/claude-prompts/triage-prompt.txt
50+
github_token: ${{ secrets.GITHUB_TOKEN }}
51+
allowed_non_write_users: "*"
52+
prompt: |
53+
You're an issue triage assistant for GitHub issues. Your task is to analyze the issue and select appropriate labels from the provided list.
54+
55+
IMPORTANT: Don't post any comments or messages to the issue. Your only action should be to apply labels.
56+
57+
Issue Information:
58+
- REPO: ${{ github.repository }}
59+
- ISSUE_NUMBER: ${{ github.event.issue.number }}
60+
61+
TASK OVERVIEW:
62+
63+
1. First, fetch the list of labels available in this repository by running: `gh label list`. Run exactly this command with nothing else.
64+
65+
2. Next, use the GitHub tools to get context about the issue:
66+
- You have access to these tools:
67+
- mcp__github__get_issue: Use this to retrieve the current issue's details including title, description, and existing labels
68+
- mcp__github__get_issue_comments: Use this to read any discussion or additional context provided in the comments
69+
- mcp__github__update_issue: Use this to apply labels to the issue (do not use this for commenting)
70+
- mcp__github__search_issues: Use this to find similar issues that might provide context for proper categorization and to identify potential duplicate issues
71+
- mcp__github__list_issues: Use this to understand patterns in how other issues are labeled
72+
- Start by using mcp__github__get_issue to get the issue details
73+
74+
3. Analyze the issue content, considering:
75+
- The issue title and description
76+
- The type of issue (bug report, feature request, question, etc.)
77+
- Technical areas mentioned
78+
- Severity or priority indicators
79+
- User impact
80+
- Components affected
81+
82+
4. Select appropriate labels from the available labels list provided above:
83+
- Choose labels that accurately reflect the issue's nature
84+
- Be specific but comprehensive
85+
- Select priority labels if you can determine urgency (high-priority, med-priority, or low-priority)
86+
- Consider platform labels (android, ios) if applicable
87+
- 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.
88+
89+
5. Apply the selected labels:
90+
- Use mcp__github__update_issue to apply your selected labels
91+
- DO NOT post any comments explaining your decision
92+
- DO NOT communicate directly with users
93+
- If no labels are clearly applicable, do not apply any labels
94+
95+
IMPORTANT GUIDELINES:
96+
- Be thorough in your analysis
97+
- Only select labels from the provided list above
98+
- DO NOT post any comments to the issue
99+
- Your ONLY action should be to apply labels using mcp__github__update_issue
100+
- It's okay to not add any labels if none are clearly applicable
104101
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
105102
claude_args: |
106103
--model claude-sonnet-4-5-20250929

.github/workflows/oncall-triage.yml

Lines changed: 62 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -16,74 +16,12 @@ jobs:
1616
permissions:
1717
contents: read
1818
issues: write
19+
id-token: write
1920

2021
steps:
2122
- name: Checkout repository
2223
uses: actions/checkout@v4
2324

24-
- name: Create oncall triage prompt
25-
run: |
26-
mkdir -p /tmp/claude-prompts
27-
cat > /tmp/claude-prompts/oncall-triage-prompt.txt << 'EOF'
28-
You're an oncall triage assistant for GitHub issues. Your task is to identify critical issues that require immediate oncall attention.
29-
30-
Important: Don't post any comments or messages to the issues. Your only action should be to apply the "oncall" label to qualifying issues.
31-
32-
Repository: ${{ github.repository }}
33-
34-
Task overview:
35-
1. Fetch all open issues updated in the last 3 days:
36-
- Use mcp__github__list_issues with:
37-
- state="open"
38-
- first=5 (fetch only 5 issues per page)
39-
- orderBy="UPDATED_AT"
40-
- direction="DESC"
41-
- This will give you the most recently updated issues first
42-
- For each page of results, check the updatedAt timestamp of each issue
43-
- Add issues updated within the last 3 days (72 hours) to your TODO list as you go
44-
- Keep paginating using the 'after' parameter until you encounter issues older than 3 days
45-
- Once you hit issues older than 3 days, you can stop fetching (no need to fetch all open issues)
46-
47-
2. Build your TODO list incrementally as you fetch:
48-
- As you fetch each page, immediately add qualifying issues to your TODO list
49-
- One TODO item per issue number (e.g., "Evaluate issue #123")
50-
- This allows you to start processing while still fetching more pages
51-
52-
3. For each issue in your TODO list:
53-
- Use mcp__github__get_issue to read the issue details (title, body, labels)
54-
- Use mcp__github__get_issue_comments to read all comments
55-
- Evaluate whether this issue needs the oncall label:
56-
a) Is it a bug? (has "bug" label or describes bug behavior)
57-
b) Does it have at least 50 engagements? (count comments + reactions)
58-
c) Is it truly blocking? Read and understand the full content to determine:
59-
- Does this prevent core functionality from working?
60-
- Can users work around it?
61-
- Consider severity indicators: "crash", "stuck", "frozen", "hang", "unresponsive", "cannot use", "blocked", "broken"
62-
- Be conservative - only flag issues that truly prevent users from getting work done
63-
64-
4. For issues that meet all criteria and do not already have the "oncall" label:
65-
- Use mcp__github__update_issue to add the "oncall" label
66-
- Do not post any comments
67-
- Do not remove any existing labels
68-
- Do not remove the "oncall" label from issues that already have it
69-
70-
Important guidelines:
71-
- Use the TODO list to track your progress through ALL candidate issues
72-
- Process issues efficiently - don't read every single issue upfront, work through your TODO list systematically
73-
- Be conservative in your assessment - only flag truly critical blocking issues
74-
- Do not post any comments to issues
75-
- Your only action should be to add the "oncall" label using mcp__github__update_issue
76-
- Mark each issue as complete in your TODO list as you process it
77-
78-
7. After processing all issues in your TODO list, provide a summary of your actions:
79-
- Total number of issues processed (candidate issues evaluated)
80-
- Number of issues that received the "oncall" label
81-
- For each issue that got the label: list issue number, title, and brief reason why it qualified
82-
- Close calls: List any issues that almost qualified but didn't quite meet the criteria (e.g., borderline blocking, had workarounds)
83-
- If no issues qualified, state that clearly
84-
- Format the summary clearly for easy reading
85-
EOF
86-
8725
- name: Setup GitHub MCP Server
8826
run: |
8927
mkdir -p /tmp/mcp-config
@@ -110,11 +48,70 @@ jobs:
11048
11149
- name: Run Claude Code for Oncall Triage
11250
timeout-minutes: 10
113-
uses: anthropics/claude-code-base-action@v1
51+
uses: anthropics/claude-code-action@v1
11452
env:
11553
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11654
with:
117-
prompt_file: /tmp/claude-prompts/oncall-triage-prompt.txt
55+
github_token: ${{ secrets.GITHUB_TOKEN }}
56+
allowed_non_write_users: "*"
57+
prompt: |
58+
You're an oncall triage assistant for GitHub issues. Your task is to identify critical issues that require immediate oncall attention.
59+
60+
Important: Don't post any comments or messages to the issues. Your only action should be to apply the "oncall" label to qualifying issues.
61+
62+
Repository: ${{ github.repository }}
63+
64+
Task overview:
65+
1. Fetch all open issues updated in the last 3 days:
66+
- Use mcp__github__list_issues with:
67+
- state="open"
68+
- first=5 (fetch only 5 issues per page)
69+
- orderBy="UPDATED_AT"
70+
- direction="DESC"
71+
- This will give you the most recently updated issues first
72+
- For each page of results, check the updatedAt timestamp of each issue
73+
- Add issues updated within the last 3 days (72 hours) to your TODO list as you go
74+
- Keep paginating using the 'after' parameter until you encounter issues older than 3 days
75+
- Once you hit issues older than 3 days, you can stop fetching (no need to fetch all open issues)
76+
77+
2. Build your TODO list incrementally as you fetch:
78+
- As you fetch each page, immediately add qualifying issues to your TODO list
79+
- One TODO item per issue number (e.g., "Evaluate issue #123")
80+
- This allows you to start processing while still fetching more pages
81+
82+
3. For each issue in your TODO list:
83+
- Use mcp__github__get_issue to read the issue details (title, body, labels)
84+
- Use mcp__github__get_issue_comments to read all comments
85+
- Evaluate whether this issue needs the oncall label:
86+
a) Is it a bug? (has "bug" label or describes bug behavior)
87+
b) Does it have at least 50 engagements? (count comments + reactions)
88+
c) Is it truly blocking? Read and understand the full content to determine:
89+
- Does this prevent core functionality from working?
90+
- Can users work around it?
91+
- Consider severity indicators: "crash", "stuck", "frozen", "hang", "unresponsive", "cannot use", "blocked", "broken"
92+
- Be conservative - only flag issues that truly prevent users from getting work done
93+
94+
4. For issues that meet all criteria and do not already have the "oncall" label:
95+
- Use mcp__github__update_issue to add the "oncall" label
96+
- Do not post any comments
97+
- Do not remove any existing labels
98+
- Do not remove the "oncall" label from issues that already have it
99+
100+
Important guidelines:
101+
- Use the TODO list to track your progress through ALL candidate issues
102+
- Process issues efficiently - don't read every single issue upfront, work through your TODO list systematically
103+
- Be conservative in your assessment - only flag truly critical blocking issues
104+
- Do not post any comments to issues
105+
- Your only action should be to add the "oncall" label using mcp__github__update_issue
106+
- Mark each issue as complete in your TODO list as you process it
107+
108+
7. After processing all issues in your TODO list, provide a summary of your actions:
109+
- Total number of issues processed (candidate issues evaluated)
110+
- Number of issues that received the "oncall" label
111+
- For each issue that got the label: list issue number, title, and brief reason why it qualified
112+
- Close calls: List any issues that almost qualified but didn't quite meet the criteria (e.g., borderline blocking, had workarounds)
113+
- If no issues qualified, state that clearly
114+
- Format the summary clearly for easy reading
118115
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
119116
claude_args: |
120117
--mcp-config /tmp/mcp-config/mcp-servers.json

0 commit comments

Comments
 (0)