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

View File

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