Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Update util.ts
  • Loading branch information
guicamest authored Nov 14, 2025
commit ebfc458f30e8da6caeb5cd66ac311699cba1297b
10 changes: 5 additions & 5 deletions src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,16 +140,16 @@ export function getVersionFromFileContent(
javaVersionRegExp = /(?<version>(?<=(^|\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)
Expand Down
Loading