From e7cc19aadeabe1ade379a9a17ab8a18d632d08f1 Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Thu, 20 Jan 2022 18:23:44 +0800 Subject: [PATCH] Skip version check in CI --- lib/core-server/src/utils/update-check.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/core-server/src/utils/update-check.ts b/lib/core-server/src/utils/update-check.ts index 4f6340784ecb..12228156c4a6 100644 --- a/lib/core-server/src/utils/update-check.ts +++ b/lib/core-server/src/utils/update-check.ts @@ -5,7 +5,7 @@ import semver from '@storybook/semver'; import dedent from 'ts-dedent'; import { VersionCheck, cache } from '@storybook/core-common'; -const { STORYBOOK_VERSION_BASE = 'https://storybook.js.org' } = process.env; +const { STORYBOOK_VERSION_BASE = 'https://storybook.js.org', CI } = process.env; export const updateCheck = async (version: string): Promise => { let result; @@ -14,7 +14,7 @@ export const updateCheck = async (version: string): Promise => { const fromCache = await cache.get('lastUpdateCheck', { success: false, time: 0 }); // if last check was more then 24h ago - if (time - 86400000 > fromCache.time) { + if (time - 86400000 > fromCache.time && !CI) { const fromFetch: any = await Promise.race([ fetch(`${STORYBOOK_VERSION_BASE}/versions.json?current=${version}`), // if fetch is too slow, we won't wait for it