Skip to content

Commit b3231ea

Browse files
authored
adds claude triage action and doc for operator chart (#1465)
Signed-off-by: ChrisJBurns <[email protected]>
1 parent 74b6fa7 commit b3231ea

File tree

2 files changed

+116
-0
lines changed

2 files changed

+116
-0
lines changed

.github/workflows/issue-triage.yml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
name: Claude Issue Triage
2+
description: Run Claude Code for issue triage in GitHub Actions
3+
on:
4+
issues:
5+
types: [opened]
6+
7+
jobs:
8+
triage-issue:
9+
runs-on: ubuntu-latest
10+
timeout-minutes: 10
11+
permissions:
12+
contents: read
13+
issues: write
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Setup GitHub MCP Server
22+
run: |
23+
mkdir -p /tmp/mcp-config
24+
cat > /tmp/mcp-config/mcp-servers.json << 'EOF'
25+
{
26+
"mcpServers": {
27+
"github": {
28+
"command": "docker",
29+
"args": [
30+
"run",
31+
"-i",
32+
"--rm",
33+
"-e",
34+
"GITHUB_PERSONAL_ACCESS_TOKEN",
35+
"ghcr.io/github/github-mcp-server:sha-efef8ae"
36+
],
37+
"env": {
38+
"GITHUB_PERSONAL_ACCESS_TOKEN": "${{ secrets.GITHUB_TOKEN }}"
39+
}
40+
}
41+
}
42+
}
43+
EOF
44+
45+
- name: Create triage prompt
46+
run: |
47+
mkdir -p /tmp/claude-prompts
48+
cat > /tmp/claude-prompts/triage-prompt.txt << 'EOF'
49+
You're an issue triage assistant for GitHub issues. Your task is to analyze the issue and select appropriate labels from the provided list.
50+
51+
IMPORTANT: Don't post any comments or messages to the issue. Your only action should be to apply labels.
52+
53+
Issue Information:
54+
- REPO: ${{ github.repository }}
55+
- ISSUE_NUMBER: ${{ github.event.issue.number }}
56+
57+
TASK OVERVIEW:
58+
59+
1. First, fetch the list of labels available in this repository by running: `gh label list`. Run exactly this command with nothing else.
60+
61+
2. Next, use the GitHub tools to get context about the issue:
62+
- You have access to these tools:
63+
- mcp__github__get_issue: Use this to retrieve the current issue's details including title, description, and existing labels
64+
- mcp__github__get_issue_comments: Use this to read any discussion or additional context provided in the comments
65+
- mcp__github__update_issue: Use this to apply labels to the issue (do not use this for commenting)
66+
- mcp__github__search_issues: Use this to find similar issues that might provide context for proper categorization and to identify potential duplicate issues
67+
- mcp__github__list_issues: Use this to understand patterns in how other issues are labeled
68+
- Start by using mcp__github__get_issue to get the issue details
69+
70+
3. Analyze the issue content, considering:
71+
- The issue title and description
72+
- The type of issue (bug report, feature request, question, etc.)
73+
- Technical areas mentioned
74+
- Severity or priority indicators
75+
- User impact
76+
- Components affected
77+
78+
4. Select appropriate labels from the available labels list provided above:
79+
- Choose labels that accurately reflect the issue's nature
80+
- Be specific but comprehensive
81+
- Select priority labels if you can determine urgency (p0, p1, or p2)
82+
- Consider platform labels (kubernetes) if applicable
83+
- 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.
84+
85+
5. Apply the selected labels:
86+
- Use mcp__github__update_issue to apply your selected labels
87+
- DO NOT post any comments explaining your decision
88+
- DO NOT communicate directly with users
89+
- If no labels are clearly applicable, do not apply any labels
90+
91+
IMPORTANT GUIDELINES:
92+
- Be thorough in your analysis
93+
- Only select labels from the provided list above
94+
- DO NOT post any comments to the issue
95+
- Your ONLY action should be to apply labels using mcp__github__update_issue
96+
- It's okay to not add any labels if none are clearly applicable
97+
EOF
98+
99+
- name: Run Claude Code for Issue Triage
100+
uses: anthropics/claude-code-base-action@beta
101+
with:
102+
prompt_file: /tmp/claude-prompts/triage-prompt.txt
103+
allowed_tools: "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"
104+
mcp_config: /tmp/mcp-config/mcp-servers.json
105+
timeout_minutes: "5"
106+
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}

deploy/charts/operator/CLAUDE.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Claude.md
2+
3+
This document will contain vital pieces of information for Claude to better understand how to do things around the Operator Helm Chart in the codebase.
4+
5+
## Bumping Operator Chart
6+
When you are asked to bump the Operator Helm chart, you will need to do the following:
7+
- Change the Chart Version in the Chart.yaml to the version you've been asked to bump it to
8+
- Also make this change to the version in the README.md (the Chart version is also in a badge)
9+
- Bump the `appVersion` in the Chart.yaml to the version that the Operator Image is being bumped too
10+
- Run `pre-commit run --all-files` to auto-generate the docs with the new updated versions

0 commit comments

Comments
 (0)