feat: branch protection + deps caching
This commit is contained in:
@@ -11,11 +11,30 @@ const dir = dirname(fileURLToPath(import.meta.url));
|
||||
|
||||
if (!existsSync(`${dir}/node_modules`)) {
|
||||
console.error("» installing dependencies...");
|
||||
execSync("npm install --no-fund --no-audit", {
|
||||
cwd: dir,
|
||||
stdio: "inherit",
|
||||
timeout: 120_000,
|
||||
});
|
||||
|
||||
// Try to activate pnpm via corepack (Node 24 ships corepack).
|
||||
// If that works, use pnpm with the lockfile for a fast, reproducible install.
|
||||
// Otherwise fall back to plain npm install.
|
||||
let installed = false;
|
||||
try {
|
||||
execSync("corepack enable pnpm", { stdio: "pipe" });
|
||||
execSync("pnpm install --frozen-lockfile", {
|
||||
cwd: dir,
|
||||
stdio: "inherit",
|
||||
timeout: 120_000,
|
||||
});
|
||||
installed = true;
|
||||
} catch {
|
||||
// corepack or pnpm not available
|
||||
}
|
||||
|
||||
if (!installed) {
|
||||
execSync("npm install --no-fund --no-audit", {
|
||||
cwd: dir,
|
||||
stdio: "inherit",
|
||||
timeout: 120_000,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const [{ main }, core] = await Promise.all([
|
||||
|
||||
Reference in New Issue
Block a user