Skip to content

Commit

Permalink
Rename release notes for 3.0.0-rc to 3.0.0.rc (github#17510)
Browse files Browse the repository at this point in the history
* Change -rc versions to .rc\d*

* Fix the download link

* Rename to 3.0.0.rc1
  • Loading branch information
JasonEtco authored Jan 27, 2021
1 parent c11f66d commit 591e22d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion layouts/release-notes.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ <h2 class="border-bottom-0 m-0 p-0">
<span class="IssueLabel bg-orange text-white ml-3" style="white-space: pre">Release Candidate</span>
{% endif %}

<a href="https://enterprise.github.com/releases/{{ patch.version | replace: '-rc', '' }}/download" class="ml-3 text-small text-bold">
<a href="https://enterprise.github.com/releases/{{ patch.downloadVersion }}/download" class="ml-3 text-small text-bold">
Download
</a>

Expand Down
10 changes: 9 additions & 1 deletion middleware/contextualizers/enterprise-release-notes.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,15 @@ const enterpriseReleases = require('../../lib/enterprise-server-releases').suppo
*/
function sortPatchKeys (release, version) {
const keys = Object.keys(release)
.map(key => ({ version: `${version}.${key}`, patchVersion: key, ...release[key] }))
.map(key => {
const keyWithDots = key.replace(/-/g, '.')
return {
version: `${version}.${keyWithDots}`,
patchVersion: keyWithDots,
downloadVersion: `${version}.${keyWithDots.replace(/\.rc\d*$/, '')}`,
...release[key]
}
})
return keys
.sort((a, b) => {
if (semver.gt(a.version, b.version)) return -1
Expand Down

0 comments on commit 591e22d

Please sign in to comment.