From 186b6551422a08b0f8353fea666c293291a633e1 Mon Sep 17 00:00:00 2001 From: Philipp Burckhardt Date: Wed, 18 Jun 2025 10:38:47 -0500 Subject: [PATCH 1/2] Add workflows for Claude Code --- .github/workflows/claude-auto-review.yml | 37 ++++++++++++++++++++++++ .github/workflows/claude.yml | 37 ++++++++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 .github/workflows/claude-auto-review.yml create mode 100644 .github/workflows/claude.yml diff --git a/.github/workflows/claude-auto-review.yml b/.github/workflows/claude-auto-review.yml new file mode 100644 index 000000000..c83afda3f --- /dev/null +++ b/.github/workflows/claude-auto-review.yml @@ -0,0 +1,37 @@ +name: Claude Auto Review + +on: + pull_request: + types: [opened] + +jobs: + auto-review: + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: read + id-token: write + steps: + - name: Checkout repository + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + fetch-depth: 1 + + - name: Automatic PR Review + uses: anthropics/claude-code-action@beta + with: + anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} + timeout_minutes: "60" + direct_prompt: | + Please review this pull request and provide actionable feedback. + + Focus on: + - Code quality and best practices + - Potential bugs or issues + - Performance considerations + - Security implications + - Overall architecture and design decisions + + Provide constructive feedback with specific suggestions for improvement. + Use inline comments to highlight specific areas of concern. Be concise and clear in your feedback. + allowed_tools: "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" diff --git a/.github/workflows/claude.yml b/.github/workflows/claude.yml new file mode 100644 index 000000000..dfcb19611 --- /dev/null +++ b/.github/workflows/claude.yml @@ -0,0 +1,37 @@ +name: Claude Code + +on: + issue_comment: + types: [created] + pull_request_review_comment: + types: [created] + issues: + types: [opened, assigned] + pull_request_review: + types: [submitted] + +jobs: + claude: + 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 == 'pull_request_review' && contains(github.event.review.body, '@claude')) || + (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude'))) + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: read + issues: read + id-token: write + steps: + - name: Checkout repository + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + fetch-depth: 1 + + - name: Run Claude Code + id: claude + uses: anthropics/claude-code-action@beta + with: + anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} + From e85931ad79cc2cdb6853a5cf3e8932e52d0fc79f Mon Sep 17 00:00:00 2001 From: Philipp Burckhardt Date: Wed, 18 Jun 2025 13:22:46 -0400 Subject: [PATCH 2/2] Add write permission for issues Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com> Signed-off-by: Philipp Burckhardt --- .github/workflows/claude.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/claude.yml b/.github/workflows/claude.yml index dfcb19611..cb1c2cb68 100644 --- a/.github/workflows/claude.yml +++ b/.github/workflows/claude.yml @@ -20,8 +20,8 @@ jobs: runs-on: ubuntu-latest permissions: contents: read - pull-requests: read - issues: read + pull-requests: write + issues: write id-token: write steps: - name: Checkout repository