Compare commits

...

4 Commits

Author SHA1 Message Date
Claude
bc7726d63e Update triggers to catch comments on older issues
Changes:
- Remove "labeled" trigger (not needed)
- Keep issue_comment trigger which catches ALL new comments, including on older issues
- Clarify in prompt that comments on older issues will be evaluated
- This ensures older issues that get new engagement can be flagged as oncall

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-20 05:56:26 +00:00
Claude
d678ba9059 Refactor: Process only recent issues to improve performance
Changes the workflow to be event-driven and process fewer issues:
- Triggers on issue events (opened, edited, labeled, reopened) and comments
- When triggered by event, processes only that specific issue
- When running on schedule, only checks issues created in last 7 days
- Only adds oncall label, never removes it
- Uses search_issues instead of list_issues for better filtering

This dramatically reduces the dataset size and makes the workflow
more efficient and scalable.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-20 05:45:11 +00:00
Claude
d5e4871e63 Fix: Use reactionGroups field for counting reactions
Updates the prompt to correctly reference the reactionGroups field
instead of reactions when counting engagements.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-20 05:41:11 +00:00
Claude
626bd3fa9c Add oncall issue triage workflow
Creates a new scheduled workflow that identifies critical issues requiring
oncall attention based on:
- Must be a bug
- Must be blocking users from using Claude Code
- Last activity within 3 days
- At least 5 engagements (reactions + comments)

The workflow runs every 6 hours and applies/removes the "oncall" label
automatically.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-20 05:27:47 +00:00

View File

@@ -0,0 +1,120 @@
name: Claude Oncall Issue Triage
description: Identify critical issues that require oncall attention
on:
issues:
types: [opened, edited, reopened]
issue_comment:
types: [created]
schedule:
# Run every 6 hours to catch issues that recently crossed the threshold
- cron: '0 */6 * * *'
workflow_dispatch: # Allow manual trigger
jobs:
oncall-triage:
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
issues: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Create oncall triage prompt
run: |
mkdir -p /tmp/claude-prompts
cat > /tmp/claude-prompts/oncall-triage-prompt.txt << 'EOF'
You're an oncall triage assistant for GitHub issues. Your task is to identify critical issues that require immediate oncall attention.
IMPORTANT: Don't post any comments or messages to the issues. Your only action should be to apply the "oncall" label to qualifying issues.
Repository: ${{ github.repository }}
Triggered by: ${{ github.event_name }}
Issue number (if triggered by issue event or comment): ${{ github.event.issue.number }}
TASK OVERVIEW:
1. Determine which issues to process:
- If this workflow was triggered by an issue event or comment (issue number provided above), process ONLY that issue
- This includes NEW comments on OLDER issues - they may now qualify for oncall if they meet the criteria
- If triggered by schedule or manual trigger, use mcp__github__search_issues to find issues created in the last 7 days (use query: "is:issue is:open created:>=$(date -d '7 days ago' +%Y-%m-%d)")
- This keeps the dataset small and focused on recent activity
2. For each issue to process, gather information using GitHub MCP tools:
- Issue details (title, body, labels) using mcp__github__get_issue
- All comments using mcp__github__get_issue_comments
- Reaction counts from the reactionGroups field
3. Evaluate each issue against the oncall criteria. An issue is oncall-worthy if ALL of the following are true:
a) Must be a bug:
- The issue has a "bug" label OR
- The issue content clearly describes a bug (error, crash, unexpected behavior)
b) Must be blocking users from using Claude Code:
- Look for keywords indicating severity: "crash", "stuck", "frozen", "hang", "unresponsive", "cannot use", "blocked", "broken"
- The issue prevents core functionality from working
- Users cannot work around the issue
c) Last activity is within the last 3 days:
- Check the issue's updated_at timestamp
- Calculate if it was updated within the last 72 hours from now
- Activity includes: new comments, reactions, or label changes
d) At least 5 engagements:
- Count total reactions from the reactionGroups field (sum all reaction counts)
- Count total number of comments
- Sum must be >= 5
4. For issues that meet ALL criteria above AND don't already have the "oncall" label:
- Use mcp__github__update_issue to add the "oncall" label
- DO NOT post any comments
- DO NOT remove any existing labels
5. Do NOT remove the "oncall" label from any issues
IMPORTANT GUIDELINES:
- Be conservative in your assessment - only flag truly critical blocking issues
- ALL four criteria must be met for an issue to receive the "oncall" label
- DO NOT post any comments to issues
- Your ONLY action should be to apply the "oncall" label using mcp__github__update_issue
- Only add the label, never remove it
- Process efficiently - only check recent issues (last 7 days) when running on schedule
EOF
- name: Setup GitHub MCP Server
run: |
mkdir -p /tmp/mcp-config
cat > /tmp/mcp-config/mcp-servers.json << 'EOF'
{
"mcpServers": {
"github": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"GITHUB_PERSONAL_ACCESS_TOKEN",
"ghcr.io/github/github-mcp-server:sha-7aced2b"
],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "${{ secrets.GITHUB_TOKEN }}"
}
}
}
}
EOF
- name: Run Claude Code for Oncall Triage
uses: anthropics/claude-code-base-action@beta
with:
prompt_file: /tmp/claude-prompts/oncall-triage-prompt.txt
allowed_tools: "mcp__github__search_issues,mcp__github__get_issue,mcp__github__get_issue_comments,mcp__github__update_issue"
timeout_minutes: "10"
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
mcp_config: /tmp/mcp-config/mcp-servers.json
claude_env: |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}