ci: use git when running as an Action

This commit is contained in:
2024-06-04 08:40:56 -04:00
parent 905e93c7e7
commit 0dfdd45143
2 changed files with 7 additions and 1 deletions

View File

@@ -30,7 +30,12 @@ await logStep("Comparing env.d.ts", async () => {
return;
}
spawn({ cmd: ["sl", "diff", "src/types/env.d.ts"], stdout: "inherit" });
const isCI = process.env["IS_CI"] === "true";
const vcsCommand = isCI ? "git" : "sl";
spawn({
cmd: [vcsCommand, "diff", "src/types/env.d.ts"],
stdout: "inherit",
});
// add 1 second to make sure spawn completes
await sleep(1000);
throw new Error("env.d.ts is out of date");