From f3db9cb674594b228eb4d017272be3b7cde7aedf Mon Sep 17 00:00:00 2001 From: Luke Watts Date: Tue, 9 Aug 2022 08:14:47 +0200 Subject: [PATCH] fix: align formatting of release notes with semantic release The default convention for semantic release is: * Capitalized headers * Bug Fixes before Features * Lists of commit items --- src/compose.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/compose.ts b/src/compose.ts index 6fa5f71..d73eb9d 100644 --- a/src/compose.ts +++ b/src/compose.ts @@ -1,6 +1,8 @@ import * as config from './config'; import { ICommitData } from './types'; +const listSeperator = '* '; + export function previewFromCommits(commitsData: ICommitData): string { if (commitsData.feat.length === 0 && commitsData.fix.length === 0) { return ''; @@ -8,19 +10,19 @@ export function previewFromCommits(commitsData: ICommitData): string { let title = '**Expected release notes'; if (config.GITHUB_PR_USERNAME) { - title += ` (by @${config.GITHUB_PR_USERNAME})`; + title += ` (by @${config.GITHUB_PR_USERNAME})`; } title += '**'; let body = ''; if (commitsData.feat.length > 0) { - body += '\n_features_:\n' + commitsData.feat.join('\n') + '\n'; + body += '\n_Features_:\n' + commitsData.feat.join(listSeperator) + '\n'; } if (commitsData.fix.length > 0) { - body += '\n_fixes_:\n' + commitsData.fix.join('\n') + '\n'; + body += '\n_Fixes_:\n' + commitsData.fix.join(listSeperator) + '\n'; } if (commitsData.others.length > 0) { - body += '\n_others (will not be included in Semantic-Release notes)_:\n' + commitsData.others.join('\n'); + body += '\n_Others (will not be included in Semantic-Release notes)_:\n' + commitsData.others.join(listSeperator); } // TODO probably make this configurable