Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

repo sync #11609

Merged
merged 15 commits into from
Nov 2, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
500 on /en/enterprise-server@2.16/admin (#22532)
* 500 on /en/enterprise-server@2.16/admin

* Update release-notes.js
  • Loading branch information
heiskr authored Nov 2, 2021
commit d6d40a974ea905592c9c56c94b8d98979eaa50be
3 changes: 2 additions & 1 deletion middleware/contextualizers/release-notes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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`)
Expand Down