From ebfc458f30e8da6caeb5cd66ac311699cba1297b Mon Sep 17 00:00:00 2001 From: guicamest <283778+guicamest@users.noreply.github.com> Date: Fri, 14 Nov 2025 17:39:57 +0100 Subject: [PATCH] Update util.ts --- src/util.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/util.ts b/src/util.ts index 7aafee07..6f1f58e3 100644 --- a/src/util.ts +++ b/src/util.ts @@ -140,16 +140,16 @@ export function getVersionFromFileContent( javaVersionRegExp = /(?(?<=(^|\s|-))(\d+\S*))(\s|$)/; } - const fileContent = content.match(javaVersionRegExp)?.groups?.version + const capturedVersion = content.match(javaVersionRegExp)?.groups?.version ? (content.match(javaVersionRegExp)?.groups?.version as string) : ''; - if (!fileContent) { + + core.debug(`Parsed version '${capturedVersion}' from file '${versionFileName}'`); + if (!capturedVersion) { return null; } - core.debug(`Version from file '${fileContent}'`); - - const tentativeVersion = avoidOldNotation(fileContent); + const tentativeVersion = avoidOldNotation(capturedVersion); const rawVersion = tentativeVersion.split('-')[0]; let version = semver.validRange(rawVersion)