mirror of
https://github.com/actions/setup-java.git
synced 2025-11-20 15:24:07 +00:00
Update util.ts
This commit is contained in:
parent
507f216ca0
commit
ebfc458f30
10
src/util.ts
10
src/util.ts
@ -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)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user