From 8f16b00d0752ad9dffd791c2f825db061b69dff5 Mon Sep 17 00:00:00 2001 From: Spencer Bryngelson Date: Sat, 4 Apr 2026 17:40:01 -0400 Subject: [PATCH 1/3] Modify CLAUDE code review workflow for PR handling Updated the workflow to fetch the PR branch and adjusted checkout depth. --- .github/workflows/claude-code-review.yml | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/.github/workflows/claude-code-review.yml b/.github/workflows/claude-code-review.yml index 47a4824040..e0fddf9273 100644 --- a/.github/workflows/claude-code-review.yml +++ b/.github/workflows/claude-code-review.yml @@ -41,14 +41,11 @@ jobs: sudo apt-get update sudo apt-get install -y unzip jq - - name: Checkout base repo - uses: actions/checkout@v4 - with: - fetch-depth: 1 - - name: Determine PR number id: mode shell: bash + env: + GH_TOKEN: ${{ github.token }} run: | set -euo pipefail @@ -61,7 +58,21 @@ jobs: exit 1 fi + PR_HEAD_REF="$(gh pr view "$PR_NUMBER" --repo "${{ github.repository }}" --json headRefName --jq .headRefName)" + echo "pr_number=$PR_NUMBER" >> "$GITHUB_OUTPUT" + echo "pr_head_ref=$PR_HEAD_REF" >> "$GITHUB_OUTPUT" + + - name: Checkout base repo + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Fetch PR branch + shell: bash + run: | + set -euo pipefail + git fetch origin "${{ steps.mode.outputs.pr_head_ref }}" - name: Resolve review state id: state From 98693d88ea34eb050015841d086cce6c41666662 Mon Sep 17 00:00:00 2001 From: Spencer Bryngelson Date: Sat, 4 Apr 2026 18:23:02 -0400 Subject: [PATCH 2/3] Use environment variable for PR branch fetch --- .github/workflows/claude-code-review.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/claude-code-review.yml b/.github/workflows/claude-code-review.yml index e0fddf9273..c51dda2659 100644 --- a/.github/workflows/claude-code-review.yml +++ b/.github/workflows/claude-code-review.yml @@ -70,9 +70,11 @@ jobs: - name: Fetch PR branch shell: bash + env: + PR_HEAD_REF: ${{ steps.mode.outputs.pr_head_ref }} run: | set -euo pipefail - git fetch origin "${{ steps.mode.outputs.pr_head_ref }}" + git fetch origin "$PR_HEAD_REF" - name: Resolve review state id: state From 1ced0660ebf543812b1964bbb68ffcc1e4e5b8c9 Mon Sep 17 00:00:00 2001 From: Spencer Bryngelson Date: Sat, 4 Apr 2026 18:36:31 -0400 Subject: [PATCH 3/3] Remove positive confirmation guideline from code review --- .github/workflows/claude-code-review.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/claude-code-review.yml b/.github/workflows/claude-code-review.yml index c51dda2659..2e9a810842 100644 --- a/.github/workflows/claude-code-review.yml +++ b/.github/workflows/claude-code-review.yml @@ -227,7 +227,7 @@ jobs: - Nearby unchanged lines in changed files may be used as supporting context only. - Do NOT raise findings about code outside changed files. - Do NOT provide general repo suggestions or unrelated improvement ideas. - - Do NOT include positive confirmations like "No issues with X". + - Do NOT include positive confirmations like "No issues with X" - If confidence is low, omit the finding. Allowed workflow: