fix: install main branch deps before building, then reinstall PR deps

Main branch imports @vueuse/router which isn't in PR's node_modules.
Need both: main deps for building main, PR deps for running QA scripts.
This commit is contained in:
snomiao
2026-03-20 23:43:58 +00:00
parent 28f530d53a
commit 47e5c39ac9

View File

@@ -104,10 +104,11 @@ jobs:
mv dist dist-after
git stash --include-untracked || true
git checkout origin/main -- .
# Build main with PR branch's node_modules (skip typecheck and reinstall)
# Install main's deps (may differ from PR), then build
pnpm install --frozen-lockfile || pnpm install --no-frozen-lockfile
pnpm exec vite build
mv dist dist-before
# Restore PR branch files and deps
# Restore PR branch files and reinstall PR deps
git checkout HEAD -- .
git stash pop || true
pnpm install --frozen-lockfile