fix: add automatic deployment skew protection
This commit is contained in:
1 parent
0dc16e832d
commit
d173dd3194
2 files changed
+31
No files matched your search
@@ -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,
|
||||
);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user