Skip to content

Commit 3792be0

Browse files
askdbaclaude
andcommitted
fix(ci): restore detached HEAD after benchmarks branch bootstrap
actions/checkout@v4 leaves the runner in detached HEAD state. After git checkout --orphan benchmarks, "git checkout -" has no named branch to return to and fails with "pathspec '-' did not match any file(s)". Save the SHA before the orphan checkout and restore it explicitly. Fixes benchmark (8.4, plugin) and benchmark (9.7, component) failures in CI run 26690542748. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 15658c8 commit 3792be0

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

.github/workflows/myvectorbench.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ jobs:
259259
steps.download.outcome == 'success'
260260
run: |
261261
if ! git ls-remote --exit-code origin benchmarks > /dev/null 2>&1; then
262+
SAVE_SHA=$(git rev-parse HEAD)
262263
git checkout --orphan benchmarks
263264
git reset --hard
264265
printf '# benchmarks\n\nResult history written by myvectorbench CI.\n' > README.md
@@ -267,7 +268,7 @@ jobs:
267268
-c user.email="github-actions[bot]@users.noreply.github.com" \
268269
commit -m "chore: initialize benchmarks branch"
269270
git push origin HEAD:benchmarks || true # tolerate race: another cell won
270-
git checkout -
271+
git checkout "$SAVE_SHA" # actions/checkout leaves detached HEAD; git checkout - fails
271272
fi
272273
273274
- name: Checkout benchmarks branch

0 commit comments

Comments
 (0)