Skip to content

Commit 34886be

Browse files
authored
ci(security-review): set origin/HEAD so the bundled skill's git diff works (#1327)
The /security-review slash command runs `git diff origin/HEAD...` as its first action to enumerate the PR's changes. actions/checkout doesn't set up the remote's symbolic HEAD ref, so that command fails with "ambiguous argument 'origin/HEAD...': unknown revision". Claude then loops trying variants until --max-turns 30 trips and the action exits 1. Set origin/HEAD to the PR's base ref right after checkout so the skill's git invocations resolve correctly. Run #26186045056 on PR #1321 was the trigger - 30 turns spent on shell-error recovery, no findings posted.
1 parent 32c475d commit 34886be

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

.github/workflows/pr-security-review.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,19 @@ jobs:
167167
# the base branch locally too. fetch-depth: 0 grabs the full history.
168168
fetch-depth: 0
169169

170+
- name: Set origin/HEAD for /security-review skill
171+
env:
172+
BASE_REF: ${{ steps.pr.outputs.base_ref }}
173+
run: |
174+
set -euo pipefail
175+
# actions/checkout doesn't set up the remote's symbolic HEAD ref, so
176+
# `git diff origin/HEAD...` (the first command the bundled
177+
# /security-review skill runs) fails with "ambiguous argument
178+
# 'origin/HEAD...': unknown revision". Point origin/HEAD at the PR's
179+
# base branch so the skill resolves the diff against the right ref.
180+
git remote set-head origin "$BASE_REF"
181+
git symbolic-ref refs/remotes/origin/HEAD
182+
170183
- name: Configure AWS credentials (OIDC)
171184
uses: aws-actions/configure-aws-credentials@v6
172185
with:

0 commit comments

Comments
 (0)