diff --git a/examples/claude-args-example.yml b/examples/claude-args-example.yml index 91d27bf..f12d499 100644 --- a/examples/claude-args-example.yml +++ b/examples/claude-args-example.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/checkout@v4 - name: Run Claude with custom arguments - uses: anthropics/claude-code-action@v1 + uses: anthropics/claude-code-action@v1-dev with: prompt: ${{ github.event.inputs.prompt }} anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} diff --git a/examples/claude-auto-review.yml b/examples/claude-auto-review.yml index 6fa4111..5e28039 100644 --- a/examples/claude-auto-review.yml +++ b/examples/claude-auto-review.yml @@ -1,4 +1,4 @@ -name: Claude Auto Review +name: Claude PR Auto Review on: pull_request: @@ -18,7 +18,7 @@ jobs: fetch-depth: 1 - name: Automatic PR Review - uses: anthropics/claude-code-action@v1 + uses: anthropics/claude-code-action@v1-dev with: anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} timeout_minutes: "60" @@ -32,10 +32,10 @@ jobs: - Security implications - Test coverage - Documentation updates if needed + - Verify that README.md and docs are updated for any new features or config changes Provide constructive feedback with specific suggestions for improvement. Use inline comments to highlight specific areas of concern. - # Optional: Configure specific tools for review operations - # claude_args: | - # --allowedTools "mcp__github__create_pending_pull_request_review,mcp__github__add_comment_to_pending_review,mcp__github__submit_pending_pull_request_review,mcp__github__get_pull_request_diff" + claude_args: | + --allowedTools "mcp__github__create_pending_pull_request_review,mcp__github__add_comment_to_pending_review,mcp__github__submit_pending_pull_request_review,mcp__github__get_pull_request_diff" diff --git a/examples/claude-experimental-review-mode.yml b/examples/claude-experimental-review-mode.yml index 8edf9db..dfec8b3 100644 --- a/examples/claude-experimental-review-mode.yml +++ b/examples/claude-experimental-review-mode.yml @@ -27,7 +27,7 @@ jobs: fetch-depth: 0 # Full history for better diff analysis - name: Code Review with Claude - uses: anthropics/claude-code-action@v1 + uses: anthropics/claude-code-action@v1-dev with: anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} # github_token not needed - uses default GITHUB_TOKEN for GitHub operations diff --git a/examples/claude-modes.yml b/examples/claude-modes.yml index 03304a0..c6cf162 100644 --- a/examples/claude-modes.yml +++ b/examples/claude-modes.yml @@ -23,7 +23,7 @@ jobs: issues: write id-token: write steps: - - uses: anthropics/claude-code-action@v1 + - uses: anthropics/claude-code-action@v1-dev with: anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} # Interactive mode (auto-detected when no prompt): @@ -41,7 +41,7 @@ jobs: issues: write id-token: write steps: - - uses: anthropics/claude-code-action@v1 + - uses: anthropics/claude-code-action@v1-dev with: anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} prompt: | diff --git a/examples/claude-pr-path-specific.yml b/examples/claude-pr-path-specific.yml index 7305f90..1642e7d 100644 --- a/examples/claude-pr-path-specific.yml +++ b/examples/claude-pr-path-specific.yml @@ -24,7 +24,7 @@ jobs: fetch-depth: 1 - name: Claude Code Review - uses: anthropics/claude-code-action@v1 + uses: anthropics/claude-code-action@v1-dev with: anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} timeout_minutes: "60" diff --git a/examples/claude-review-from-author.yml b/examples/claude-review-from-author.yml index 7018253..6361047 100644 --- a/examples/claude-review-from-author.yml +++ b/examples/claude-review-from-author.yml @@ -23,7 +23,7 @@ jobs: fetch-depth: 1 - name: Review PR from Specific Author - uses: anthropics/claude-code-action@v1 + uses: anthropics/claude-code-action@v1-dev with: anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} timeout_minutes: "60" diff --git a/examples/claude.yml b/examples/claude.yml index 2075a19..9e34f3e 100644 --- a/examples/claude.yml +++ b/examples/claude.yml @@ -32,7 +32,7 @@ jobs: - name: Run Claude Code id: claude - uses: anthropics/claude-code-action@v1 + uses: anthropics/claude-code-action@v1-dev with: anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} diff --git a/examples/issue-deduplication.yml b/examples/issue-deduplication.yml new file mode 100644 index 0000000..3352e74 --- /dev/null +++ b/examples/issue-deduplication.yml @@ -0,0 +1,64 @@ +name: Issue Deduplication + +on: + issues: + types: [opened] + +jobs: + deduplicate: + runs-on: ubuntu-latest + timeout-minutes: 10 + permissions: + contents: read + issues: write + id-token: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 1 + + - name: Check for duplicate issues + uses: anthropics/claude-code-action@v1-dev + with: + prompt: | + Analyze this new issue and check if it's a duplicate of existing issues in the repository. + + Issue: #${{ github.event.issue.number }} + Repository: ${{ github.repository }} + + Your task: + 1. Use mcp__github__get_issue to get details of the current issue (#${{ github.event.issue.number }}) + 2. Search for similar existing issues using mcp__github__search_issues with relevant keywords from the issue title and body + 3. Compare the new issue with existing ones to identify potential duplicates + + Criteria for duplicates: + - Same bug or error being reported + - Same feature request (even if worded differently) + - Same question being asked + - Issues describing the same root problem + + If you find duplicates: + - Add a comment on the new issue linking to the original issue(s) + - Apply a "duplicate" label to the new issue + - Be polite and explain why it's a duplicate + - Suggest the user follow the original issue for updates + + If it's NOT a duplicate: + - Don't add any comments + - You may apply appropriate topic labels based on the issue content + + Use these tools: + - mcp__github__get_issue: Get issue details + - mcp__github__search_issues: Search for similar issues + - mcp__github__list_issues: List recent issues if needed + - mcp__github__create_issue_comment: Add a comment if duplicate found + - mcp__github__update_issue: Add labels + + Be thorough but efficient. Focus on finding true duplicates, not just similar issues. + + anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} + claude_args: | + --allowedTools "mcp__github__get_issue,mcp__github__search_issues,mcp__github__list_issues,mcp__github__create_issue_comment,mcp__github__update_issue,mcp__github__get_issue_comments" + timeout_minutes: "5" diff --git a/examples/issue-triage.yml b/examples/issue-triage.yml new file mode 100644 index 0000000..9d169f2 --- /dev/null +++ b/examples/issue-triage.yml @@ -0,0 +1,76 @@ +name: Issue Triage +on: + issues: + types: [opened] + +jobs: + triage-issue: + runs-on: ubuntu-latest + timeout-minutes: 10 + permissions: + contents: read + issues: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Triage issue with Claude + uses: anthropics/claude-code-action@v1-dev + with: + 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 (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 + - Select priority labels if you can determine urgency (high-priority, med-priority, or low-priority) + - Consider platform labels (android, ios) if applicable + - 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. 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 + + anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} + claude_args: | + --allowedTools "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" diff --git a/examples/workflow-dispatch-agent.yml b/examples/workflow-dispatch-agent.yml index 4d35912..f574686 100644 --- a/examples/workflow-dispatch-agent.yml +++ b/examples/workflow-dispatch-agent.yml @@ -28,7 +28,7 @@ jobs: fetch-depth: 2 # Need at least 2 commits to analyze the latest - name: Run Claude Analysis - uses: anthropics/claude-code-action@v1 + uses: anthropics/claude-code-action@v1-dev with: anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} prompt: |