diff --git a/.github/workflows/claude-code-review.yml b/.github/workflows/claude-code-review.yml new file mode 100644 index 000000000..fe2ea8669 --- /dev/null +++ b/.github/workflows/claude-code-review.yml @@ -0,0 +1,53 @@ +name: Claude Code Review + +on: + pull_request: + types: [opened, synchronize, ready_for_review, reopened] + +jobs: + claude-review: + runs-on: ubuntu-latest + # pull-requests: write is required so `gh pr comment` and the inline-comment + # tool can post the review back onto the PR via GITHUB_TOKEN. + permissions: + contents: read + pull-requests: write + id-token: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 1 + + - name: Run Claude Code Review + id: claude-review + uses: anthropics/claude-code-action@v1 + with: + # Authenticates as the Claude subscription, so review usage is covered + # by the plan (no metered API charge). Set the CLAUDE_CODE_OAUTH_TOKEN + # secret on this repo (Settings > Secrets and variables > Actions). + claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} + prompt: | + REPO: ${{ github.repository }} + PR NUMBER: ${{ github.event.pull_request.number }} + + Review this pull request. narya is a Java distributed-object / + networking library (the Presents framework: DObjects, invocation + services/marshallers, the io streaming layer). Focus on: + - Correctness bugs and broken edge cases + - Wire-protocol / streaming compatibility (field order, Streamable + read/writeObject, backwards compatibility of serialized forms) + - Thread-safety and concurrency + - Security implications + - Code quality and existing project conventions + + The PR branch is already checked out in the working directory. + Use `gh pr comment` for a short top-level summary. + Use `mcp__github_inline_comment__create_inline_comment` (with + `confirmed: true`) to flag specific lines. + Only post GitHub comments - do not return the review as a message. + If you find nothing worth flagging, post a brief "no issues found" + summary comment. + claude_args: | + --allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*)" diff --git a/.github/workflows/claude.yml b/.github/workflows/claude.yml new file mode 100644 index 000000000..42b55edce --- /dev/null +++ b/.github/workflows/claude.yml @@ -0,0 +1,43 @@ +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 + actions: read # Required for Claude to read CI results on PRs + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 1 + + - name: Run Claude Code + id: claude + uses: anthropics/claude-code-action@v1 + with: + # Set the CLAUDE_CODE_OAUTH_TOKEN secret on this repo (Settings > + # Secrets and variables > Actions) for this to authenticate. + claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} + + # This is an optional setting that allows Claude to read CI results on PRs + additional_permissions: | + actions: read