Skip to content

Commit

Permalink
fix: use single newline for commit message list
Browse files Browse the repository at this point in the history
  • Loading branch information
bobvanderlinden committed Oct 30, 2019
1 parent fa97d75 commit 4e1202b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/commit-message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ function getCustomCommitMessage (
body: pullRequestInfo => pullRequestInfo.body,
number: pullRequestInfo => pullRequestInfo.number.toString(),
branch: pullRequestInfo => pullRequestInfo.headRefName,
commits: pullRequestInfo => pullRequestInfo.allCommits.nodes.map(node => {
return `* ${node.commit.messageHeadline} (${node.commit.abbreviatedOid})`
}).join('\n\n')
commits: pullRequestInfo => pullRequestInfo.allCommits.nodes
.map(node => `* ${node.commit.messageHeadline} (${node.commit.abbreviatedOid})`)
.join('\n')
}

return template.replace(/\{(\w+)\}/g, (match, tagName: Tag) => {
Expand Down
2 changes: 1 addition & 1 deletion test/commit-message.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ describe('getCommitMessage', () => {
const config = createConfig({
mergeCommitMessage: '{commits}'
})
expect(getCommitMessage(pullRequestInfo, config)).toEqual('* commit-1 (1111111)\n\n* commit-2 (2222222)')
expect(getCommitMessage(pullRequestInfo, config)).toEqual('* commit-1 (1111111)\n* commit-2 (2222222)')
})

it('returns multiple template tags', () => {
Expand Down

0 comments on commit 4e1202b

Please sign in to comment.