From 7256075435f45525d1b7f71f5ee169849245329b Mon Sep 17 00:00:00 2001 From: donpetry-bot <{}+donpetry-bot@users.noreply.github.com> Date: Tue, 9 Jun 2026 22:54:33 -0500 Subject: [PATCH] fix(pr-review): checkout the agent repo explicitly, not the caller (#536) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The 'Checkout agent repo' step set ref: inputs.agent_ref but no repository, so it cloned the CALLER's repo at agent_ref. That accidentally worked for self-host (caller == .github-private) but fails for consumers: invoked from markets it tried markets@pr-review/stable (no such ref) → 'Checkout agent repo' failure. Pin repository: petry-projects/.github-private (public → default token can read it) and ref: agent_ref || 'main'. Scripts always come from the agent repo regardless of which repo's PRs are reviewed; review-one-pr.sh operates via the gh API and needs no target-repo checkout. No change for self-host (was already .github-private). Surfaced by ring-1 consumer validation (markets). Promote via pr-review/stable. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/pr-review.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr-review.yml b/.github/workflows/pr-review.yml index b920a9d90..b243b7c1e 100644 --- a/.github/workflows/pr-review.yml +++ b/.github/workflows/pr-review.yml @@ -174,10 +174,14 @@ jobs: - name: Checkout agent repo uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: - # Empty agent_ref => default checkout (unchanged behaviour). A pinned - # channel (e.g. pr-review/stable) makes the agent's own scripts run at - # that version regardless of which branch triggered the run (#506). - ref: ${{ inputs.agent_ref }} + # Always check out the AGENT repo (.github-private) for the scripts — + # NOT the caller's repo. When invoked from a consumer (e.g. markets), + # the default checkout would clone the consumer at `agent_ref`, which + # has no such ref → failure. .github-private is public, so the default + # token can read it. `agent_ref` (e.g. pr-review/stable) pins the + # scripts to the known-good channel; empty defaults to main (#506/#536). + repository: petry-projects/.github-private + ref: ${{ inputs.agent_ref || 'main' }} - name: Cache claude-code CLI uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5