diff --git a/.github/workflows/claude-code-review.yml b/.github/workflows/claude-code-review.yml index ea30cb0..d67c5a8 100644 --- a/.github/workflows/claude-code-review.yml +++ b/.github/workflows/claude-code-review.yml @@ -1,7 +1,7 @@ name: Claude Code Review on: - pull_request: + pull_request_target: # Use pull_request_target instead of pull_request types: [opened, synchronize] # Runs on new PRs and updates jobs: @@ -14,7 +14,6 @@ jobs: discussions: write id-token: write statuses: write - workflow: write actions: write steps: # Check out the code to allow git diff operations @@ -22,17 +21,19 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 # Fetch full history for accurate diffs + # Important: For pull_request_target, ref needs to be explicitly set to PR head + ref: ${{ github.event.pull_request.head.sha }} - name: Run Code Review with Claude id: code-review uses: anthropics/claude-code-action@beta with: - # Your GitHub token for API operations - github_token: ${{ secrets.GITHUB_TOKEN }} - # Define the review focus areas direct_prompt: "Review the PR changes. Focus on code quality, potential bugs, and performance issues. Suggest improvements where appropriate. Pay special attention to Kubernetes operator patterns and Go best practices according to the CLAUDE.md file." + # Your GitHub token for API operations + github_token: ${{ secrets.GITHUB_TOKEN }} + # Limited tools for safer review operations allowed_tools: |- # Git inspection commands (read-only) diff --git a/.github/workflows/claude-comment-response.yml b/.github/workflows/claude-comment-response.yml index a390c45..1a74fd0 100644 --- a/.github/workflows/claude-comment-response.yml +++ b/.github/workflows/claude-comment-response.yml @@ -15,7 +15,6 @@ jobs: discussions: write id-token: write statuses: write - workflow: write actions: write steps: - name: Checkout code diff --git a/.github/workflows/claude-pr-creation.yml b/.github/workflows/claude-pr-creation.yml index d6f615b..cdb798c 100644 --- a/.github/workflows/claude-pr-creation.yml +++ b/.github/workflows/claude-pr-creation.yml @@ -20,7 +20,6 @@ jobs: discussions: write id-token: write statuses: write - workflow: write actions: write steps: - name: Checkout code