get latest version

This commit is contained in:
cupcakearmy 2022-11-01 21:31:31 +01:00
parent 22fbf4b955
commit 574c2b7b87
No known key found for this signature in database
GPG Key ID: 3235314B4D31232F
1 changed files with 2 additions and 2 deletions

View File

@ -14,8 +14,8 @@ const clean = (match) => match.replace(/"/g, '').replace('/download/nginx-', '')
const versions = matches.map(clean)
// Filter
const MIN_VERSION = '1.20.0'
const filtered = versions.filter((v) => semver.gte(v, MIN_VERSION))
// Get the two most up to date versions, mainline and stable
const filtered = versions.sort(semver.rcompare).slice(0, 2)
// Map the docker tags to the versions
const tagsMap = Object.fromEntries(filtered.map((v) => [v, v]))