1
0
mirror of synced 2025-12-21 10:57:10 -05:00

use all instead of supported because deprecated releases get special handling

This commit is contained in:
Sarah Schneider
2021-06-16 11:09:13 -04:00
parent 0553dd0b66
commit acdf131b98

View File

@@ -17,9 +17,9 @@ module.exports = async function releaseNotesContext (req, res, next) {
const [requestedPlan, requestedRelease] = req.context.currentVersion.split('@') const [requestedPlan, requestedRelease] = req.context.currentVersion.split('@')
const releaseNotesPerPlan = req.context.site.data['release-notes'][requestedPlan] const releaseNotesPerPlan = req.context.site.data['release-notes'][requestedPlan]
// 404 if no release notes can be found or the requested release is not supported // 404 if no release notes can be found or the requested release is not valid
if (!releaseNotesPerPlan) return next() if (!releaseNotesPerPlan) return next()
if (!supported.includes(requestedRelease)) return next() if (!all.includes(requestedRelease)) return next()
// Release notes handling differs if version has numbered releases (like GHES) or not (like GHAE) // Release notes handling differs if version has numbered releases (like GHES) or not (like GHAE)
const hasNumberedReleases = !(requestedRelease === 'latest') const hasNumberedReleases = !(requestedRelease === 'latest')