Skip to content

Commit 95e5cca

Browse files
authored
feat: Only do automatic commit association for Vercel production environments (#711)
1 parent 109a52a commit 95e5cca

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Diff for: packages/bundler-plugin-core/src/options-mapping.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,11 @@ export function normalizeUserOptions(userOptions: UserOptions) {
4848
process.env["VERCEL"] &&
4949
process.env["VERCEL_GIT_COMMIT_SHA"] &&
5050
process.env["VERCEL_GIT_REPO_SLUG"] &&
51-
process.env["VERCEL_GIT_REPO_OWNER"]
51+
process.env["VERCEL_GIT_REPO_OWNER"] &&
52+
// We only want to set commits for the production env because Sentry becomes extremely noisy (eg on slack) for
53+
// preview environments because the previous commit is always the "stem" commit of the preview/PR causing Sentry
54+
// to notify you for other people creating PRs.
55+
process.env["VERCEL_TARGET_ENV"] === "production"
5256
) {
5357
options.release.setCommits = {
5458
shouldNotThrowOnFailure: true,

0 commit comments

Comments
 (0)