diff --git a/.changeset/little-badgers-occur.md b/.changeset/little-badgers-occur.md new file mode 100644 index 000000000..398b5bdaa --- /dev/null +++ b/.changeset/little-badgers-occur.md @@ -0,0 +1,5 @@ +--- +"@redocly/cli": patch +--- + +Added the `REDOCLY_SUPPRESS_UPDATE_NOTICE` environment variable so that users can skip version updates. diff --git a/README.md b/README.md index ed4ce86cb..28f062471 100644 --- a/README.md +++ b/README.md @@ -97,6 +97,10 @@ If your OpenAPI description isn't everything you hoped it would be, enhance it w This tool [collects data](./docs/usage-data.md) to help Redocly improve our products and services. You can opt out by setting the `REDOCLY_TELEMETRY` environment variable to `off`. +## Update notifications + +Redocly CLI checks for updates on startup. You can disable this by setting the `REDOCLY_SUPPRESS_UPDATE_NOTICE` environment variable to `true`. + ## More resources [Read the detailed docs](https://redocly.com/docs/cli/). diff --git a/packages/cli/src/utils/update-version-notifier.ts b/packages/cli/src/utils/update-version-notifier.ts index ce8ce9c69..5beead666 100644 --- a/packages/cli/src/utils/update-version-notifier.ts +++ b/packages/cli/src/utils/update-version-notifier.ts @@ -13,7 +13,10 @@ const SPACE_TO_BORDER = 4; const INTERVAL_TO_CHECK = 1000 * 60 * 60 * 12; const SHOULD_NOT_NOTIFY = - process.env.NODE_ENV === 'test' || process.env.CI || !!process.env.LAMBDA_TASK_ROOT; + process.env.NODE_ENV === 'test' || + process.env.CI || + !!process.env.LAMBDA_TASK_ROOT || + process.env.REDOCLY_SUPPRESS_UPDATE_NOTICE === 'true'; export const notifyUpdateCliVersion = () => { if (SHOULD_NOT_NOTIFY) {