Skip to content

Commit 38da316

Browse files
committed
Link to pr (#12)
* Test (#11) * Add link to pull request in changelog
1 parent 1c72d90 commit 38da316

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

.changelog/01.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
fix
2+
Fix parentheses in pull request links

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,13 @@
99
"scripts": {
1010
"prepare": "husky"
1111
},
12-
"keywords": [],
12+
"keywords": [
13+
"changelog"
14+
],
15+
"repository": "https://github.com/single-spa/heeler",
1316
"author": "Jolyn Denning",
1417
"license": "MIT",
15-
"packageManager": "pnpm@10.13.1",
18+
"packageManager": "pnpm@10.14.0+sha512.ad27a79641b49c3e481a16a805baa71817a04bbe06a38d17e60e2eaee83f6a146c6a688125f5792e48dd5ba30e7da52a5cda4c3992b9ccf333f9ce223af84748",
1619
"dependencies": {
1720
"@inquirer/prompts": "^7.8.0",
1821
"simple-git": "^3.28.0"

src/changelog-utils.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,16 @@ export async function prepareRelease() {
8181

8282
const prMatch = /(\(#[0-9]+\))$/.exec(log.latest.message);
8383

84-
const prStr = prMatch ? " " + prMatch[1] : "";
84+
let prStr;
85+
if (prMatch) {
86+
if (packageJson.repository) {
87+
prStr = ` ([${prMatch[1].replace("(", "").replace(")", "")}](${packageJson.repository}/pull/${prMatch[1].replace("#", "")}))`;
88+
} else {
89+
prStr = ` ${prMatch[1]}`;
90+
}
91+
} else {
92+
prStr = "";
93+
}
8594

8695
newChangelogLines.push(
8796
`- ${changeType}: ${message} ${revparse}${prStr} by ${log.latest.author_name}`,

0 commit comments

Comments
 (0)