Skip to content

Commit

Permalink
fix(shared): Do not display telemetry notice in CI (#2503)
Browse files Browse the repository at this point in the history
* fix(shared): Do not display telemetry notice in CI

* Create cold-points-carry.md
  • Loading branch information
LekoArts committed Jan 8, 2024
1 parent 5dd997a commit 1dc28ab
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/cold-points-carry.md
@@ -0,0 +1,5 @@
---
"@clerk/shared": patch
---

Do not display telemetry notice in CI
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/shared/package.json
Expand Up @@ -89,6 +89,7 @@
"dependencies": {
"glob-to-regexp": "0.4.1",
"js-cookie": "3.0.1",
"std-env": "^3.7.0",
"swr": "2.2.0"
},
"devDependencies": {
Expand Down
6 changes: 5 additions & 1 deletion packages/shared/scripts/postinstall.mjs
Expand Up @@ -2,6 +2,8 @@ import fs from 'node:fs/promises';
import os from 'node:os';
import path from 'node:path';

import { isCI } from 'std-env';

// If we make significant changes to how telemetry is collected in the future, bump this version.
const TELEMETRY_NOTICE_VERSION = '1';

Expand Down Expand Up @@ -57,7 +59,9 @@ async function notifyAboutTelemetry() {

config.telemetryNoticeVersion = TELEMETRY_NOTICE_VERSION;

telemetryNotice();
if (!isCI) {
telemetryNotice();
}

await fs.writeFile(configFile, JSON.stringify(config, null, '\t'));
}
Expand Down

0 comments on commit 1dc28ab

Please sign in to comment.