mirror of
https://github.com/anthropics/claude-code.git
synced 2026-02-19 04:27:33 -08:00
- Add optional issue_number parameter to Claude Issue Triage Action - Create manual workflow that accepts comma-separated issue numbers - Maintains backward compatibility with existing issue event workflow 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
99 lines
4.6 KiB
YAML
99 lines
4.6 KiB
YAML
name: "Claude Issue Triage Action"
|
|
description: "Automatically triage GitHub issues using Claude Code"
|
|
|
|
inputs:
|
|
timeout_minutes:
|
|
description: "Timeout in minutes for execution"
|
|
required: false
|
|
default: "5"
|
|
anthropic_api_key:
|
|
description: "Anthropic API key"
|
|
required: true
|
|
github_token:
|
|
description: "GitHub token with repo and issues permissions"
|
|
required: true
|
|
issue_number:
|
|
description: "Issue number to triage (optional - defaults to event issue number)"
|
|
required: false
|
|
|
|
runs:
|
|
using: "composite"
|
|
steps:
|
|
- name: Checkout repository code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Create prompt file
|
|
shell: bash
|
|
run: |
|
|
mkdir -p /tmp/claude-prompts
|
|
cat > /tmp/claude-prompts/claude-issue-triage-prompt.txt << 'EOF'
|
|
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: ${{ inputs.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 (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. Identify existing duplicate issues:
|
|
- Use mcp__github__search_issues to find similar issues
|
|
- List out all open or recently closed issues that seem likely to be reports of the same problem
|
|
- Place the best candidate issue to merge into at the top of the list.
|
|
The best candidate issue is the one that is:
|
|
1. Has the same underlying cause as the current issue
|
|
2. Is the most complete and well-documented
|
|
3. Is the oldest open issue that is still relevant
|
|
|
|
5. Select appropriate labels from the available labels list provided above:
|
|
- Choose labels that accurately reflect the issue's nature
|
|
- Be specific but comprehensive
|
|
- Consider platform labels (macos, linux, windows) if applicable
|
|
- Do not apply the "duplicate" label unless you are certain the issue is a duplicate of another open issue
|
|
|
|
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
|
|
EOF
|
|
|
|
- name: Run Claude Code
|
|
uses: ./.github/actions/claude-code-action
|
|
with:
|
|
prompt_file: /tmp/claude-prompts/claude-issue-triage-prompt.txt
|
|
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"
|
|
install_github_mcp: "true"
|
|
timeout_minutes: ${{ inputs.timeout_minutes }}
|
|
anthropic_api_key: ${{ inputs.anthropic_api_key }}
|
|
github_token: ${{ inputs.github_token }}
|