Skip to content

Commit 53371ac

Browse files
author
Christopher - Marcel Böddecker
committed
feat(templates): merge commit messages in changelog/release note
This keeps paragraphs in the messages as is.
1 parent c8a7ee9 commit 53371ac

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

templates/steps/cd.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,17 @@ steps:
135135
writerOpts: {
136136
finalizeContext: (context) => {
137137
const prefix = ' > '
138+
context.noteGroups.forEach(group => {
139+
group.notes.forEach(note => {
140+
if (note.text) {
141+
note.text = note.text.split('\n\n').map(paragraph => paragraph.split('\n').join(' ')).join('\n\n')
142+
}
143+
})
144+
})
138145
context.commitGroups.forEach(group => {
139146
group.commits.forEach(commit => {
140147
if (commit.body) {
141-
commit.body = prefix + commit.body.split('\n').join('\n' + prefix)
148+
commit.body = prefix + commit.body.split('\n\n').map(paragraph => paragraph.split('\n').join(' ')).join('\n' + prefix + '\n' + prefix)
142149
}
143150
})
144151
group.commits = group.commits.filter(commit => !(commit.type == 'Miscellaneous Chores' && commit.scope == 'release'))

0 commit comments

Comments
 (0)