1
0
mirror of synced 2025-12-23 21:07:12 -05:00

add GHAE to the "next" version exception so we do not throw an error

This commit is contained in:
Sarah Schneider
2022-06-13 16:10:21 -04:00
parent 25c3225513
commit 76650e4ac3

View File

@@ -1,14 +1,17 @@
import { next, latest } from './enterprise-server-releases.js'
import versionSatisfiesRange from './version-satisfies-range.js'
// Special handling for frontmatter that evalues to the next GHES release number or a hardcoded `next`:
// we don't want to return it as an applicable version or it will become a permalink,
// but we also don't want to throw an error if no other versions are found.
// Special handling for frontmatter that evalues to the next GHES release number,
// GHAE `issue-\d{4}` or a hardcoded `next`. We don't want to return any of these
// as an applicable version or it will become a permalink, but we also don't want
// to throw an error if no other versions are found.
export default function checkIfNextVersionOnly(value) {
if (value === '*') return false
const ghesNextVersionOnly =
const ghesNextVersion =
versionSatisfiesRange(next, value) && !versionSatisfiesRange(latest, value)
return ghesNextVersionOnly || value === 'next'
const ghaeUpcomingVersion = value.includes('issue-')
return ghesNextVersion || ghaeUpcomingVersion || value === 'next'
}