Skip to content

Commit 7ee06d9

Browse files
bteasapphi-red
andauthored
fix: generate commit link for breaking changes (#74)
Co-authored-by: 翠 <[email protected]>
1 parent 65ad599 commit 7ee06d9

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

src/changelog.ts

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,29 @@ export const generateChangelog: typeof def = async ({
3939
{{~/if}}
4040
{{~#if isPatch~}} </small> {{~/if}}
4141
`.trim();
42-
preset.writer.mainTemplate! += "\n";
42+
preset.writer.mainTemplate =
43+
`
44+
{{> header}}
45+
{{#if noteGroups}}
46+
{{#each noteGroups}}
47+
48+
### ⚠ {{title}}
49+
50+
{{#each notes}}
51+
* {{#if commit.scope}}**{{commit.scope}}:** {{/if}}{{commit.subject}} {{#if commit.hash}}([{{commit.shortHash}}](https://github.com/{{@root.owner}}/{{@root.repository}}/commit/{{commit.hash}})){{/if}}
52+
{{/each}}
53+
{{/each}}
54+
{{/if}}
55+
{{#each commitGroups}}
56+
57+
{{#if title}}
58+
### {{title}}
59+
60+
{{/if}}
61+
{{#each commits}}
62+
{{> commit root=@root}}
63+
{{/each}}
64+
{{/each}}`.trim() + "\n";
4365

4466
const pkgDir = getPkgDir();
4567

0 commit comments

Comments
 (0)