fix: restore PR files with git checkout HEAD instead of git checkout -

git checkout - uses @{-1} which requires a previous branch switch.
Since we use 'git checkout origin/main -- .' (file checkout, not branch
switch), there is no @{-1} ref. Use HEAD to restore from current branch.

Also restore proper concurrency group.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
snomiao
2026-03-20 23:26:59 +00:00
parent 4f80c88c36
commit eda7f22fa8

View File

@@ -20,8 +20,8 @@ on:
default: focused
concurrency:
group: qa-${{ github.ref }}-${{ github.run_id }}
cancel-in-progress: false
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
resolve-matrix:
@@ -108,8 +108,8 @@ jobs:
# when built with the PR branch's lockfile/deps
pnpm exec vite build
mv dist dist-before
# Restore PR branch
git checkout - -- .
# Restore PR branch files from HEAD (not 'git checkout -' which needs @{-1})
git checkout HEAD -- .
git stash pop || true
mv dist-after dist
echo "Built both: dist-before/ (main) and dist/ (PR)"