fix: add automatic deployment skew protection
CI / check (push) Successful in 37s
CI / release (push) Skipped
CI / deploy (push) Successful in 1m28s

This commit is contained in:
Simo committed 2026-08-01 21:52:28 +02:00
1 parent 0dc16e832d
commit d173dd3194
2 files changed
+31

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
import { execFileSync } from "node:child_process";
import { describe, expect, it } from "vitest";
import nextConfig from "../../next.config";
describe("deployment version skew protection", () => {
it("uses an explicit deployment ID or the current Git commit", () => {
const gitCommit = execFileSync("git", ["rev-parse", "HEAD"], {
encoding: "utf8",
}).trim();
expect(nextConfig.deploymentId).toBe(
process.env.NEXT_DEPLOYMENT_ID?.trim() || gitCommit,
);
});
});