You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 1aa2925
Browse filesBrowse the repository at this point in the historyBrowse files
fix(cli): Warn when .env.sentry-build-plugin holds the placeholder token
When the wizard could not create an auth token, the React Native wizard
wrote the placeholder to .env.sentry-build-plugin and still said it put
the auth token there. Like the Android wizard, warn that the file holds a
placeholder, that Release builds fail at the Sentry upload until it is
replaced, and show the token settings URL. Tag auth-token-placeholder.
@@ -490,16 +498,38 @@ export async function patchNativeFiles({
490
498
return;
491
499
}
492
500
493
-
clack.log.info(
494
-
`The wizard put the auth token in ${dotEnvFile}, which is gitignored, and only the ${propertiesConfig.url ? "org, project and server URL" : "org and project"} in ${files}, so commit ${several ? "those" : "that"}. In CI, set ${envVar} to a token from:\n${settingsUrl}`,
495
-
);
501
+
constpropertiesNote=`The wizard put only the ${propertiesConfig.url ? "org, project and server URL" : "org and project"} in ${files}, so commit ${several ? "those" : "that"}.`;
502
+
if(placeholderToken){
503
+
clack.log.warn(
504
+
`${dotEnvFile} holds a placeholder auth token (${chalk.cyan(`"${DUMMY_AUTH_TOKEN}"`)}), so Release builds fail at the Sentry upload until you replace it with a token from:\n${settingsUrl}\n${dotEnvFile} is gitignored. ${propertiesNote} In CI, set ${envVar}.`,
505
+
);
506
+
}else{
507
+
clack.log.info(
508
+
`The wizard put the auth token in ${dotEnvFile}, which is gitignored. ${propertiesNote} In CI, set ${envVar} to a token from:\n${settingsUrl}`,
509
+
);
510
+
}
496
511
for(constfileoffilesWithEarlierToken){
497
512
clack.log.warn(
498
513
`${chalk.cyan(file)} already has an ${chalk.cyan("auth.token")} line from an earlier setup, so the file may already be committed with the token. The wizard didn't change it. Remove the line, since builds now read the token from ${dotEnvFile}, and if the file was pushed, rotate the token at:\n${settingsUrl}`,
499
514
);
500
515
}
501
516
}
502
517
518
+
/**
519
+
* Whether `.env.sentry-build-plugin` ends up with the placeholder token. The
520
+
* file keeps a token it already had, so that one counts, not this run's
521
+
* `authToken`. When the file can't be read, `authToken` decides.
0 commit comments