Skip to content

Commit 13950c9

Browse files
committed
fix: fixing bug with major version generic updater
1 parent 33e2d6d commit 13950c9

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/updaters/generic.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import {logger as defaultLogger, Logger} from '../util/logger';
1818

1919
const VERSION_REGEX =
2020
/(?<major>\d+)\.(?<minor>\d+)\.(?<patch>\d+)(-(?<preRelease>[\w.]+))?(\+(?<build>[-\w.]+))?/;
21+
const MAJOR_VERSION_REGEX = /\d+\b/
2122
const SINGLE_VERSION_REGEX = /\b\d+\b/;
2223
const INLINE_UPDATE_REGEX =
2324
/x-release-please-(?<scope>major|minor|patch|version)/;
@@ -91,7 +92,7 @@ export class Generic extends DefaultUpdater {
9192
function replaceVersion(line: string, scope: BlockScope, version: Version) {
9293
switch (scope) {
9394
case 'major':
94-
newLines.push(line.replace(SINGLE_VERSION_REGEX, `${version.major}`));
95+
newLines.push(line.replace(MAJOR_VERSION_REGEX, `${version.major}`));
9596
return;
9697
case 'minor':
9798
newLines.push(line.replace(SINGLE_VERSION_REGEX, `${version.minor}`));

0 commit comments

Comments
 (0)