chore: add triage agent (#26939)

This commit is contained in:
andig 2026-01-23 17:16:14 +01:00 • committed by GitHub
parent 5c3f378ee6
commit 1becd41a98
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 1110 additions and 89 deletions

View file

@ -1,89 +0,0 @@
name: Claude Issue Triage
on:
issues:
types: [opened]
jobs:
triage-issue:
runs-on: depot-ubuntu-24.04-arm
timeout-minutes: 10
permissions:
contents: read
issues: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run Claude Code
uses: anthropics/claude-code-base-action@beta
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
mcp_config: |
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "${{ secrets.GITHUB_TOKEN }}"
}
}
}
}
prompt: |
You're an issue triage assistant for GitHub issues. Your task is to analyze the issue and select appropriate labels from the provided list.
IMPORTANT: Don't post any comments or messages to the issue. Your only action should be to apply labels.
Issue Information:
- REPO: ${{ github.repository }}
- ISSUE_NUMBER: ${{ github.event.issue.number }}
TASK OVERVIEW:
1. First, fetch the list of labels available in this repository by running: `gh label list`. Run exactly this command with nothing else.
2. Next, use the GitHub tools to get context about the issue:
- You have access to these tools:
- mcp__github__get_issue: Use this to retrieve the current issue's details including title, description, and existing labels
- mcp__github__get_issue_comments: Use this to read any discussion or additional context provided in the comments
- mcp__github__update_issue: Use this to apply labels to the issue or set issue type (do not use this for commenting)
- mcp__github__search_issues: Use this to find similar issues that might provide context for proper categorization and to identify potential duplicate issues
- mcp__github__list_issues: Use this to understand patterns in how other issues are labeled
- Start by using mcp__github__get_issue to get the issue details
3. Analyze the issue content, considering:
- The issue title and description
- The type of issue (bug report, feature request, question, etc.)
- Technical areas mentioned
- Severity or priority indicators
- User impact
- Components affected
4. Select appropriate labels from the available labels list provided above:
- Choose labels that accurately reflect the issue's nature
- Be specific but comprehensive
- 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.
5. Use issue type instead of labels if the issue is a feature request or bug report:
- If the issue is a feature request, set the issue type to "feature request". Do not apply the "enhancement" label.
- If the issue is a bug report, set the issue type to "bug". Do not apply the "bug" label.
6. Apply the selected labels:
- Use mcp__github__update_issue to apply your selected labels
- DO NOT post any comments explaining your decision
- DO NOT communicate directly with users
- If no labels are clearly applicable, do not apply any labels
IMPORTANT GUIDELINES:
- Be thorough in your analysis
- Only select labels from the provided list above
- DO NOT post any comments to the issue
- Your ONLY action should be to apply labels using mcp__github__update_issue
- It's okay to not add any labels if none are clearly applicable
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"
timeout_minutes: "5"
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}

1068
.github/workflows/issue-triage-agent.lock.yml generated vendored Normal file

File diff suppressed because it is too large Load diff

41
.github/workflows/issue-triage-agent.md vendored Normal file
View file

@ -0,0 +1,41 @@
---
timeout-minutes: 5
strict: true
on:
issues:
types: [opened, edited, reopened]
pull_request:
types: [opened, edited, reopened]
permissions:
issues: read
pull-requests: read
tools:
github:
toolsets: [issues, pull_requests, labels]
safe-outputs:
add-labels:
allowed: [bug, enhancement, documentation, question, device, tariff, vehicle]
add-comment: {}
source: githubnext/gh-aw/.github/workflows/issue-triage-agent.md@87fe98fa15e2bb50f41225a356bbc07318b54fcf
---
# Issue/Pull request Triage Agent
## Label the Issue/Pull Request
Look at the issue/pull request. Analyze title and body, then add one of the allowed labels: `bug`, `enhancement`, `documentation`, `question`, `device`, `tariff`, `vehicle`.
Skip updating the issue/pull request if it already has a label attached.
If you add the `bug` label, also set the issue type to `bug`.
## Identify Supporters
If an issue is a `bug`, try to identify potential causes by looking at recent pull requests not older than 3 months.
If you find pull requests that may have introduced the bug, try identifying potential supporters for the issue. Supporters may be:
- authors or commentators of the pull request
- code owners for the code modified in the pull request (see CODEOWNERS file)
If you can identify a pull request that may have introduced the bug, mention the pull request in the issue. If identified, mention the supporter, explaining why he was mentioned.