From 972b3195e76b3e97232ca1670dde57c9063bec11 Mon Sep 17 00:00:00 2001 From: jnasbyupgrade Date: Thu, 6 Aug 2026 18:52:57 -0500 Subject: [PATCH] Fix claude-code-review.yml trust gate: check PR author, not head repo owner head.repo.owner.login only identifies who owns the fork on fork-headed PRs. For an upstream-branch-headed PR (base and head both in this repo -- e.g. from gh stack, or gh pr create without a fork), it's always this repo's own org, never the actual author, so the gate silently skipped review on every such PR regardless of who opened it. Check pull_request.user.login instead, which identifies the actual PR author in both cases. Co-Authored-By: Claude Sonnet 5 --- .github/workflows/claude-code-review.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/claude-code-review.yml b/.github/workflows/claude-code-review.yml index 6585d24..c220338 100644 --- a/.github/workflows/claude-code-review.yml +++ b/.github/workflows/claude-code-review.yml @@ -21,11 +21,18 @@ 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. + # + # NOTE: this checks the PR AUTHOR (user.login), not head.repo.owner.login. + # head.repo.owner.login only identifies "who owns the fork" for fork-headed + # PRs -- for an upstream-branch-headed PR (base and head both in this repo, + # e.g. from `gh stack`, or `gh pr create` without a fork), it's always this + # repo's own org, never the actual author, so that check silently skipped + # review on every such PR regardless of who opened it. 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: