From 0c023f5ef71ea44840d7761f491c3c0e697ca4db Mon Sep 17 00:00:00 2001 From: Luca Forstner Date: Mon, 31 Mar 2025 09:49:54 +0200 Subject: [PATCH] feat: Only do automatic commit association for Vercel production environments --- packages/bundler-plugin-core/src/options-mapping.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/bundler-plugin-core/src/options-mapping.ts b/packages/bundler-plugin-core/src/options-mapping.ts index 8b1976fe..83bf11cb 100644 --- a/packages/bundler-plugin-core/src/options-mapping.ts +++ b/packages/bundler-plugin-core/src/options-mapping.ts @@ -48,7 +48,11 @@ export function normalizeUserOptions(userOptions: UserOptions) { process.env["VERCEL"] && process.env["VERCEL_GIT_COMMIT_SHA"] && process.env["VERCEL_GIT_REPO_SLUG"] && - process.env["VERCEL_GIT_REPO_OWNER"] + process.env["VERCEL_GIT_REPO_OWNER"] && + // We only want to set commits for the production env because Sentry becomes extremely noisy (eg on slack) for + // preview environments because the previous commit is always the "stem" commit of the preview/PR causing Sentry + // to notify you for other people creating PRs. + process.env["VERCEL_TARGET_ENV"] === "production" ) { options.release.setCommits = { shouldNotThrowOnFailure: true,