Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/claude-auto-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
with:
allowed_tools: "mcp__github__create_pull_request,mcp__github__create_issue,mcp__github__search_issues,mcp__github__update_issue,mcp__github__create_pending_pull_request_review,mcp__github__add_pull_request_review_comment_to_pending_review,mcp__github__submit_pending_pull_request_review,mcp__github__get_pull_request_diff"
use_bedrock: true
model: "us.anthropic.claude-opus-4-5-20251101-v1:0"
model: "us.anthropic.claude-opus-4-6-v1"
fallback_model: "us.anthropic.claude-3-7-sonnet-20250219-v1:0"
timeout_minutes: "60"
direct_prompt: |
Expand Down
74 changes: 74 additions & 0 deletions .github/workflows/claude.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Claude PR Assistant

on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
issues:
types: [opened, assigned]
pull_request_review:
types: [submitted]

env:
PTD_AWS_ACCOUNT: ${{ secrets.PTD_AWS_ACCOUNT }}

jobs:
claude-code-action:
if: |
(
github.event_name == 'issue_comment' &&
contains(github.event.comment.body, '@claude')
) ||
(
github.event_name == 'pull_request_review_comment' &&
contains(github.event.comment.body, '@claude')
) ||
(
github.event_name == 'issues' &&
contains(github.event.issue.body, '@claude')
)
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
issues: write
id-token: write
steps:
- name: Check actor has write permission
env:
GH_TOKEN: ${{ github.token }}
run: |
PERMISSION=$(gh api /repos/${{ github.repository }}/collaborators/${{ github.actor }}/permission --jq '.permission')
if [[ "$PERMISSION" != "admin" && "$PERMISSION" != "write" ]]; then
echo "::error::Actor ${{ github.actor }} has '$PERMISSION' permission, requires 'write' or 'admin'"
exit 1
fi
echo "Actor ${{ github.actor }} authorized with '$PERMISSION' permission"

- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1

- uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::${{ env.PTD_AWS_ACCOUNT }}:role/claude-code
role-session-name: gha-claude-code-action
aws-region: us-east-2

- name: Run Claude Code Action
uses: anthropics/claude-code-action@beta
with:
model: "us.anthropic.claude-opus-4-6-v1"
fallback_model: "us.anthropic.claude-3-7-sonnet-20250219-v1:0"
timeout_minutes: "60"
use_bedrock: true
branch_prefix: "claude-"
additional_permissions: "actions: read"
allowed_tools: "mcp__github__create_pull_request,mcp__github__create_issue,mcp__github__search_issues,mcp__github__update_issue,mcp__github__create_pending_pull_request_review,mcp__github__add_pull_request_review_comment_to_pending_review,mcp__github__submit_pending_pull_request_review,mcp__github__get_pull_request_diff"
custom_instructions: |
You are a helpful AI assistant for code reviews and issue triage.
Respond to comments and issues that mention you with relevant code suggestions or triage actions.
If you cannot assist, politely inform the user. In your responses, don't be overly complimentary.
Stick to the facts and provide actionable advice.