Skip to content

Commit 577f4ed

Browse files
committed
Replace main branch in changelog link with tags
1 parent 8c7e6d4 commit 577f4ed

2 files changed

Lines changed: 4 additions & 7 deletions

File tree

β€Žscripts/release/steps/show-instructions-after-npm-publish.jsβ€Ž

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ const RELEASE_URL_BASE = "https://github.com/prettier/prettier/releases/new?";
1111
export function getReleaseUrl(version, previousVersion) {
1212
const semverDiff = semver.diff(version, previousVersion);
1313
const isPatch = semverDiff === "patch";
14+
const tag = version;
1415
let body;
1516
if (isPatch) {
1617
const urlToChangelog =
17-
"https://github.com/prettier/prettier/blob/main/CHANGELOG.md#" +
18+
`https://github.com/prettier/prettier/blob/${tag}/CHANGELOG.md#` +
1819
version.split(".").join("");
1920
body = `πŸ”— [Changelog](${urlToChangelog})`;
2021
} else {
@@ -25,11 +26,7 @@ export function getReleaseUrl(version, previousVersion) {
2526
body: `πŸ”— [Release note](https://prettier.io/${blogPostInfo.path})`,
2627
});
2728
}
28-
const parameters = new URLSearchParams({
29-
tag: version,
30-
title: version,
31-
body,
32-
});
29+
const parameters = new URLSearchParams({ tag, title: version, body });
3330
return `${RELEASE_URL_BASE}${parameters}`;
3431
}
3532

β€Žscripts/release/tests/publish-to-npm.test.jsβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ describe("publish-to-npm", () => {
2424
getExpectedReleaseUrl({
2525
tag: "2.3.1",
2626
title: "2.3.1",
27-
body: "πŸ”— [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md#231)",
27+
body: "πŸ”— [Changelog](https://github.com/prettier/prettier/blob/2.3.1/CHANGELOG.md#231)",
2828
}),
2929
);
3030
});

0 commit comments

Comments
Β (0)