diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 38d6844..83fb3db 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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: diff --git a/src/scripts/verifyEnv.ts b/src/scripts/verifyEnv.ts index 59ad8fc..e8a68bc 100644 --- a/src/scripts/verifyEnv.ts +++ b/src/scripts/verifyEnv.ts @@ -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");