mirror of
https://github.com/actions/setup-java
synced 2024-12-22 21:22:41 +00:00
Update index.js
This commit is contained in:
parent
f8061412c6
commit
ae687a76f9
1 changed files with 3007 additions and 2998 deletions
13
dist/index.js
generated
vendored
13
dist/index.js
generated
vendored
|
@ -4643,8 +4643,17 @@ function normalizeVersion(version) {
|
|||
throw new Error('1. is not a valid version');
|
||||
}
|
||||
}
|
||||
// Add trailing .x if it is missing
|
||||
if (version.split('.').length != 3) {
|
||||
if (version.endsWith('-ea')) {
|
||||
// convert e.g. 14-ea to 14.0.0-ea
|
||||
if (version.indexOf('.') == -1) {
|
||||
version = version.slice(0, version.length - 3) + '.0.0-ea';
|
||||
}
|
||||
// match anything in -ea.X (semver won't do .x matching on pre-release versions)
|
||||
if (version[0] >= '0' && version[0] <= '9') {
|
||||
version = '>=' + version;
|
||||
}
|
||||
} else if (version.split('.').length < 3) {
|
||||
// For non-ea versions, add trailing .x if it is missing
|
||||
if (version[version.length - 1] != 'x') {
|
||||
version = version + '.x';
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue