diff --git a/middleware/contextualizers/release-notes.js b/middleware/contextualizers/release-notes.js index 56c0d54bca70..d241466ec7a3 100644 --- a/middleware/contextualizers/release-notes.js +++ b/middleware/contextualizers/release-notes.js @@ -20,6 +20,7 @@ export default async function releaseNotesContext(req, res, next) { if (!(req.pagePath.endsWith('/release-notes') || req.pagePath.endsWith('/admin'))) return next() const [requestedPlan, requestedRelease] = req.context.currentVersion.split('@') + const releaseNotesPerPlan = req.context.site.data['release-notes'][requestedPlan] // Release notes handling differs if version has numbered releases (like GHES) or not (like GHAE) @@ -33,7 +34,7 @@ export default async function releaseNotesContext(req, res, next) { if (hasNumberedReleases) { const currentReleaseNotes = releaseNotesPerPlan[`${requestedRelease.replace(/\./g, '-')}`] - if (!currentReleaseNotes && req.pagePath.endsWith('/release-notes')) { + if (!currentReleaseNotes) { // If the GHES version doesn't have any release notes, let's be helpful and redirect to `enterprise.github.com` return requestedPlan === 'enterprise-server' ? res.redirect(`https://enterprise.github.com/releases/${requestedRelease}.0/notes`)