From 7157c10d77819f79d1b451642cd46a11c15590aa Mon Sep 17 00:00:00 2001 From: John Miller Date: Mon, 18 Nov 2024 08:58:01 -0700 Subject: [PATCH] fix: fixing bug with major version generic updater --- src/updaters/generic.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/updaters/generic.ts b/src/updaters/generic.ts index 42cc268c5..caa962d7f 100644 --- a/src/updaters/generic.ts +++ b/src/updaters/generic.ts @@ -18,6 +18,7 @@ import {logger as defaultLogger, Logger} from '../util/logger'; const VERSION_REGEX = /(?\d+)\.(?\d+)\.(?\d+)(-(?[\w.]+))?(\+(?[-\w.]+))?/; +const MAJOR_VERSION_REGEX = /\d+\b/ const SINGLE_VERSION_REGEX = /\b\d+\b/; const INLINE_UPDATE_REGEX = /x-release-please-(?major|minor|patch|version)/; @@ -91,7 +92,7 @@ export class Generic extends DefaultUpdater { function replaceVersion(line: string, scope: BlockScope, version: Version) { switch (scope) { case 'major': - newLines.push(line.replace(SINGLE_VERSION_REGEX, `${version.major}`)); + newLines.push(line.replace(MAJOR_VERSION_REGEX, `${version.major}`)); return; case 'minor': newLines.push(line.replace(SINGLE_VERSION_REGEX, `${version.minor}`));