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

fix: update detection of changelog links #587

Merged
merged 1 commit into from
Nov 3, 2021
Merged
Changes from all commits
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
6 changes: 2 additions & 4 deletions lib/prepare_release.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,17 +333,15 @@ class ReleasePreparation {

const major = versionComponents.major;
const hrefLink = `doc/changelogs/CHANGELOG_V${major}.md`;
const escapedHrefLink = hrefLink.replace(/_/g, '\\_');
const newRefLink = `<a href="${hrefLink}#${newVersion}">${newVersion}</a>`;
const lastRefLink = `<a href="${hrefLink}#${lastRef}">${lastRef}</a>`;

for (let idx = 0; idx < arr.length; idx++) {
if (isLTSTransition) {
if (arr[idx].includes(escapedHrefLink)) {
arr[idx] = arr[idx].replace('**Current**', '**Long Term Support**');
} else if (arr[idx].includes(hrefLink)) {
if (arr[idx].includes(hrefLink)) {
const eolDate = getEOLDate(date);
const eol = eolDate.toISOString().split('-').slice(0, 2).join('-');
arr[idx] = arr[idx].replace('**Current**', '**Long Term Support**');
arr[idx] = arr[idx].replace('"Current"', `"LTS Until ${eol}"`);
arr[idx] = arr[idx].replace('(Current)', '(LTS)');
} else if (arr[idx].includes('**Long Term Support**')) {
Expand Down