Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/skip-update-check-env.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@workflow/cli": patch
---

Support `WORKFLOW_NO_UPDATE_CHECK=1` env var to skip the npm registry version check on startup
7 changes: 7 additions & 0 deletions packages/cli/src/lib/update-check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,17 @@ async function isCacheValid(
/**
* Check for updates with filesystem caching
* Cache is valid unless the local version changes
*
* Set WORKFLOW_NO_UPDATE_CHECK=1 to skip the update check entirely.
*/
export async function checkForUpdateCached(
currentVersion: string
): Promise<VersionCheckResult> {
if (process.env.WORKFLOW_NO_UPDATE_CHECK === '1') {
logger.debug('Skipping update check (WORKFLOW_NO_UPDATE_CHECK=1)');
return { currentVersion, needsUpdate: false };
}

const cacheFile = getVersionCheckCacheFile();

// Check if cache is valid
Expand Down
1 change: 1 addition & 0 deletions packages/core/e2e/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ const awaitCommand = async (
env: {
...process.env,
DEBUG: '1',
WORKFLOW_NO_UPDATE_CHECK: '1',
...envOverrides,
},
});
Expand Down
Loading