Skip to content

Commit 3d39988

Browse files
committed
feat: format release line
1 parent b42436b commit 3d39988

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

.changeset/dry-seals-kiss.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@cherry-markdown/changesets-changelog-github": patch
3+
---
4+
5+
feat: format release line

packages/changesets-changelog-github/src/index.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,25 @@ const changelogFunctions: ChangelogFunctions = {
3737

3838
return [changesetLink, ...updatedDependenciesList].join('\n');
3939
},
40-
getReleaseLine: async (changeset, type, changelogOpts) => {
40+
getReleaseLine: async (changeset, _type, changelogOpts) => {
4141
validateChangelogOpts(changelogOpts);
42-
console.log('changeset', changeset, type, changelogOpts);
4342
const { summary, commit } = changeset;
43+
if (!commit) {
44+
throw new Error(
45+
'No commit found for changeset, this should not happen, please open an issue'
46+
)
47+
};
4448

45-
const data= await getInfo({
49+
const commitInfo= await getInfo({
4650
repo: changelogOpts?.repo,
4751
commit: commit
4852
})
4953

54+
const commitUser= commitInfo.links?.user ? `${commitInfo.links?.user}` : "";
55+
const commitPull= commitInfo.links?.pull ? `(${commitInfo.links?.pull})` : "";
56+
const commitCommit= commitInfo.links?.commit ? `(${commitInfo.links?.commit})` : "";
5057

51-
return `- ${summary}`;
52-
58+
return `- ${summary} ${commitUser}${commitPull}${commitCommit}`;
5359
}
5460
};
5561

0 commit comments

Comments
 (0)