ci: use git when running as an Action
This commit is contained in:
1
.github/workflows/main.yml
vendored
1
.github/workflows/main.yml
vendored
@@ -19,6 +19,7 @@ jobs:
|
||||
run: bun src/scripts/verifyEnv.ts
|
||||
env:
|
||||
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||
IS_CI: true
|
||||
- name: Deploy
|
||||
uses: cloudflare/wrangler-action@v3
|
||||
with:
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user