Commit def89e1
Split AI review checkout by PR state (open vs closed)
Three rounds of review feedback have surfaced overlapping checkout
robustness concerns. Picking one approach and unifying behind it.
Closed/merged PR path (the audit-campaign use case):
Use `refs/pull/<N>/head` from the base repo. GitHub keeps this
mirror durably regardless of whether the original branch is
deleted, the fork is removed, or the merge was rebase/squash.
Replaces the prior `refs/pull/<N>/merge` checkout, which is
garbage-collected on close.
Open PR path:
Use `head_sha` from `head_repo_full_name`. For owner PRs the
head repo equals github.repository so this is identical to a
base-repo checkout. For fork PRs it avoids the documented race
where the base repo has not yet mirrored a freshly API-created
fork PR's head (.claude/commands/submit-pr.md:327-345).
base_sha lives on github.repository regardless of which checkout
path runs, so the prefetch step continues to add a `base` remote
explicitly. `git diff BASE_SHA HEAD_SHA` therefore finds both
trees locally in every covered scenario.
The PR state is sourced from `pulls.get` in the existing metadata
step (works for both `pull_request` and `issue_comment` events).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 3c02cab commit def89e1
1 file changed
Lines changed: 21 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| 86 | + | |
86 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
87 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
88 | 106 | | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | 107 | | |
100 | 108 | | |
101 | 109 | | |
102 | 110 | | |
103 | 111 | | |
104 | 112 | | |
105 | 113 | | |
106 | | - | |
107 | | - | |
108 | | - | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
109 | 117 | | |
110 | 118 | | |
111 | 119 | | |
| |||
0 commit comments