From af6fa82385cb7b6b6874b2b66247b0a4e2be62e3 Mon Sep 17 00:00:00 2001 From: jnasbyupgrade Date: Thu, 6 Aug 2026 18:56:32 -0500 Subject: [PATCH] Fix claude-code-review.yml trust gate: check PR author, not head repo owner github.event.pull_request.head.repo.owner.login only identifies who owns the fork for fork-headed PRs. For an upstream-branch-headed PR (base and head both live in this repo, as required by gh stack, or just what gh pr create produces without a fork), head.repo.owner.login is always this repo's own org, never the actual PR author -- so the gate silently skipped review on every such PR regardless of who opened it. Check github.event.pull_request.user.login instead: it identifies the PR author directly, can't be spoofed by a third party any more than head repo owner can, and works for both fork-headed and upstream-branch-headed PRs. Co-Authored-By: Claude Sonnet 5 --- .github/workflows/claude-code-review.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/claude-code-review.yml b/.github/workflows/claude-code-review.yml index 17dfb68..63faa4b 100644 --- a/.github/workflows/claude-code-review.yml +++ b/.github/workflows/claude-code-review.yml @@ -27,11 +27,11 @@ concurrency: jobs: claude-review: - # Trusted fork only, and skip drafts (don't spend API/CI on unfinished PRs). - # To add more trusted owners, extend the head-owner check. + # Trusted author only, and skip drafts (don't spend API/CI on unfinished PRs). + # To add more trusted authors, extend the author check. if: >- github.event.pull_request.draft == false && - github.event.pull_request.head.repo.owner.login == 'jnasbyupgrade' + github.event.pull_request.user.login == 'jnasbyupgrade' runs-on: ubuntu-latest timeout-minutes: 60 permissions: