mirror of
https://github.com/actions/setup-java.git
synced 2025-04-19 17:36:45 +00:00
changed the validation for .java-version type
This commit is contained in:
parent
0b8af766df
commit
d265fde39f
3 changed files with 3 additions and 11 deletions
5
dist/cleanup/index.js
vendored
5
dist/cleanup/index.js
vendored
|
@ -88363,11 +88363,8 @@ function getVersionFromFileContent(content, distributionName, versionFile) {
|
||||||
javaVersionRegExp =
|
javaVersionRegExp =
|
||||||
/^(java\s+)(?:\S*-)?v?(?<version>(\d+)(\.\d+)?(\.\d+)?(\+\d+)?(-ea(\.\d+)?)?)$/m;
|
/^(java\s+)(?:\S*-)?v?(?<version>(\d+)(\.\d+)?(\.\d+)?(\+\d+)?(-ea(\.\d+)?)?)$/m;
|
||||||
}
|
}
|
||||||
else if (versionFileName == '.java-version') {
|
|
||||||
javaVersionRegExp = /(?<version>(?<=(^|\s|-))(\d+\S*))(\s|$)/;
|
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
throw new Error('Invalid version file');
|
javaVersionRegExp = /(?<version>(?<=(^|\s|-))(\d+\S*))(\s|$)/;
|
||||||
}
|
}
|
||||||
const fileContent = ((_b = (_a = content.match(javaVersionRegExp)) === null || _a === void 0 ? void 0 : _a.groups) === null || _b === void 0 ? void 0 : _b.version)
|
const fileContent = ((_b = (_a = content.match(javaVersionRegExp)) === null || _a === void 0 ? void 0 : _a.groups) === null || _b === void 0 ? void 0 : _b.version)
|
||||||
? (_d = (_c = content.match(javaVersionRegExp)) === null || _c === void 0 ? void 0 : _c.groups) === null || _d === void 0 ? void 0 : _d.version
|
? (_d = (_c = content.match(javaVersionRegExp)) === null || _c === void 0 ? void 0 : _c.groups) === null || _d === void 0 ? void 0 : _d.version
|
||||||
|
|
5
dist/setup/index.js
vendored
5
dist/setup/index.js
vendored
|
@ -125737,11 +125737,8 @@ function getVersionFromFileContent(content, distributionName, versionFile) {
|
||||||
javaVersionRegExp =
|
javaVersionRegExp =
|
||||||
/^(java\s+)(?:\S*-)?v?(?<version>(\d+)(\.\d+)?(\.\d+)?(\+\d+)?(-ea(\.\d+)?)?)$/m;
|
/^(java\s+)(?:\S*-)?v?(?<version>(\d+)(\.\d+)?(\.\d+)?(\+\d+)?(-ea(\.\d+)?)?)$/m;
|
||||||
}
|
}
|
||||||
else if (versionFileName == '.java-version') {
|
|
||||||
javaVersionRegExp = /(?<version>(?<=(^|\s|-))(\d+\S*))(\s|$)/;
|
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
throw new Error('Invalid version file');
|
javaVersionRegExp = /(?<version>(?<=(^|\s|-))(\d+\S*))(\s|$)/;
|
||||||
}
|
}
|
||||||
const fileContent = ((_b = (_a = content.match(javaVersionRegExp)) === null || _a === void 0 ? void 0 : _a.groups) === null || _b === void 0 ? void 0 : _b.version)
|
const fileContent = ((_b = (_a = content.match(javaVersionRegExp)) === null || _a === void 0 ? void 0 : _a.groups) === null || _b === void 0 ? void 0 : _b.version)
|
||||||
? (_d = (_c = content.match(javaVersionRegExp)) === null || _c === void 0 ? void 0 : _c.groups) === null || _d === void 0 ? void 0 : _d.version
|
? (_d = (_c = content.match(javaVersionRegExp)) === null || _c === void 0 ? void 0 : _c.groups) === null || _d === void 0 ? void 0 : _d.version
|
||||||
|
|
|
@ -128,10 +128,8 @@ export function getVersionFromFileContent(
|
||||||
if (versionFileName == '.tool-versions') {
|
if (versionFileName == '.tool-versions') {
|
||||||
javaVersionRegExp =
|
javaVersionRegExp =
|
||||||
/^(java\s+)(?:\S*-)?v?(?<version>(\d+)(\.\d+)?(\.\d+)?(\+\d+)?(-ea(\.\d+)?)?)$/m;
|
/^(java\s+)(?:\S*-)?v?(?<version>(\d+)(\.\d+)?(\.\d+)?(\+\d+)?(-ea(\.\d+)?)?)$/m;
|
||||||
} else if (versionFileName == '.java-version') {
|
|
||||||
javaVersionRegExp = /(?<version>(?<=(^|\s|-))(\d+\S*))(\s|$)/;
|
|
||||||
} else {
|
} else {
|
||||||
throw new Error('Invalid version file');
|
javaVersionRegExp = /(?<version>(?<=(^|\s|-))(\d+\S*))(\s|$)/;
|
||||||
}
|
}
|
||||||
|
|
||||||
const fileContent = content.match(javaVersionRegExp)?.groups?.version
|
const fileContent = content.match(javaVersionRegExp)?.groups?.version
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue