From 0ea64d68a752d639ba44deeede249038f3074844 Mon Sep 17 00:00:00 2001 From: Saurabh Daware Date: Fri, 6 Dec 2024 11:30:57 +0530 Subject: [PATCH] fix: isPR condition (#2438) --- packages/blade/src/utils/storybook/Sandbox/baseCode.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/blade/src/utils/storybook/Sandbox/baseCode.ts b/packages/blade/src/utils/storybook/Sandbox/baseCode.ts index 38bd70f29e4..27af952e4c8 100644 --- a/packages/blade/src/utils/storybook/Sandbox/baseCode.ts +++ b/packages/blade/src/utils/storybook/Sandbox/baseCode.ts @@ -3,11 +3,13 @@ import dedent from 'dedent'; // @ts-expect-error We don't resolve JSON files right now. didn't want to change TS config for single JSON import packageJson from '../../../../package.json'; // eslint-disable-line -export const isPR = Boolean(process.env.GITHUB_SHA); +const isMaster = process.env.GITHUB_REF === 'refs/heads/master'; + +export const isPR = Boolean(process.env.GITHUB_SHA) && !isMaster; const getBladeVersion = (): string => { // We don't publish codesandbox ci on master so version is not present - const isMaster = process.env.GITHUB_REF === 'refs/heads/master'; + const sha = process.env.GITHUB_SHA; if (sha && !isMaster) { const shortSha = sha.slice(0, 8);