Skip to content

feat: Only do automatic commit association for Vercel production environments #711

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 31, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion packages/bundler-plugin-core/src/options-mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Copy link
Member

@Lms24 Lms24 Mar 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way that users can overwrite this env variable for their production build? I guess though even if it's possible, it's probably an edge case we can ignore live with (?)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had the same thought: I think we just don't care. I don't think many people would change their prod env name at all.

) {
options.release.setCommits = {
shouldNotThrowOnFailure: true,
Expand Down
Loading