diff --git a/packages/deploy-utils/src/prepare-prod-deploy/index.ts b/packages/deploy-utils/src/prepare-prod-deploy/index.ts index 67aeef9ec..b019d2f33 100644 --- a/packages/deploy-utils/src/prepare-prod-deploy/index.ts +++ b/packages/deploy-utils/src/prepare-prod-deploy/index.ts @@ -69,5 +69,17 @@ export const prepareProdDeploy = async () => { const version = getReleaseVersion(commitMessages); console.log(`This deploy is a ${version} release.`); + + const { value: shouldDeploy } = await prompts({ + type: "confirm", + name: "value", + message: "Do you want to deploy?", + initial: true, + }); + if (!shouldDeploy) { + console.log("Deploy cancelled."); + return; + } + createTagAndPush(version); }; diff --git a/packages/deploy-utils/src/prepare-prod-deploy/prepare-prod-deploy.test.ts b/packages/deploy-utils/src/prepare-prod-deploy/prepare-prod-deploy.test.ts index f1413b38d..8017e77c6 100644 --- a/packages/deploy-utils/src/prepare-prod-deploy/prepare-prod-deploy.test.ts +++ b/packages/deploy-utils/src/prepare-prod-deploy/prepare-prod-deploy.test.ts @@ -61,6 +61,7 @@ describe("prepareProdDeploy", () => { it("creates tag with patch", async () => { const consoleSpy = vi.spyOn(console, "log").mockImplementation(vi.fn()); + vi.mocked(prompts).mockResolvedValueOnce({ value: true }); await prepareProdDeploy(); expect(vi.mocked(getCurrentlyDeployedCommit)).toHaveBeenCalledWith( "spruce",