mirror of
https://github.com/actions/setup-java.git
synced 2025-04-20 09:56:46 +00:00
ver parse
This commit is contained in:
parent
d4cd9e298e
commit
5a37903655
2 changed files with 6 additions and 2 deletions
|
@ -27,7 +27,9 @@ async function run() {
|
|||
const contents = fs.readFileSync(versionFileName).toString().trim();
|
||||
const semverRegExp = /(\d+\.\d+\.\d+|\d+\.\d+|\d+$)/
|
||||
const version = semverRegExp.test(contents) ? RegExp.$1 : "";
|
||||
core.info(semver.valid(version) ? semver.valid(version) as string : "not found")
|
||||
const coercedVer = semver.coerce(version)
|
||||
const validVer = semver.valid(coercedVer)
|
||||
core.info(validVer ? validVer as string : "not found")
|
||||
versions.push(contents)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue