Skip to content

Commit 635a60f

Browse files
author
Luca Forstner
authored
fix: Use automatic release name detection for release injection (#271)
1 parent 707c8c9 commit 635a60f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/bundler-plugin-core/src/index.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import { createLogger } from "./sentry/logger";
1111
import { allowedToSendTelemetry, createSentryInstance } from "./sentry/telemetry";
1212
import { Options } from "./types";
1313
import {
14-
determineReleaseName,
1514
generateGlobalInjectorCode,
1615
getDependencies,
1716
getPackageJson,
@@ -138,8 +137,7 @@ export function sentryUnpluginFactory({
138137
plugins.push(releaseInjectionPlugin(injectionCode));
139138
}
140139

141-
const releaseManagementPluginReleaseName = options.release.name ?? determineReleaseName();
142-
if (!releaseManagementPluginReleaseName) {
140+
if (!options.release.name) {
143141
logger.warn(
144142
"No release name provided. Will not create release. Please set the `release.name` option to identifiy your release."
145143
);
@@ -159,7 +157,7 @@ export function sentryUnpluginFactory({
159157
plugins.push(
160158
releaseManagementPlugin({
161159
logger,
162-
releaseName: releaseManagementPluginReleaseName,
160+
releaseName: options.release.name,
163161
shouldCreateRelease: options.release.create,
164162
shouldCleanArtifacts: options.release.cleanArtifacts,
165163
shouldFinalizeRelease: options.release.finalize,

packages/bundler-plugin-core/src/options-mapping.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Logger } from "./sentry/logger";
22
import { Options as UserOptions } from "./types";
3+
import { determineReleaseName } from "./utils";
34

45
export type NormalizedOptions = ReturnType<typeof normalizeUserOptions>;
56

@@ -20,6 +21,7 @@ export function normalizeUserOptions(userOptions: UserOptions) {
2021
sourcemaps: userOptions.sourcemaps,
2122
release: {
2223
...userOptions.release,
24+
name: userOptions.release?.name ?? determineReleaseName(),
2325
inject: userOptions.release?.inject ?? true,
2426
create: userOptions.release?.create ?? true,
2527
finalize: userOptions.release?.finalize ?? true,

0 commit comments

Comments
 (0)