From 8d0921953344af9568f51b98bc75afbdf135b1ce Mon Sep 17 00:00:00 2001 From: Jeremy Apthorp Date: Tue, 12 Feb 2019 21:30:39 -0800 Subject: [PATCH] chore: 'breaking change' in PR body overrides commit type in relnotes (#16911) --- script/release-notes/notes.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/script/release-notes/notes.js b/script/release-notes/notes.js index 1a3e070b3f9d..e83d0a34bb8f 100644 --- a/script/release-notes/notes.js +++ b/script/release-notes/notes.js @@ -521,10 +521,13 @@ const getNotes = async (fromRef, toRef, newVersion) => { } // try to pull a release note from the pull comment - const prParsed = {} - parseCommitMessage(`${prData.data.title}\n\n${prData.data.body}`, pr.owner, pr.repo, prParsed) - commit.note = commit.note || prParsed.note - commit.type = commit.type || prParsed.type + const prParsed = parseCommitMessage(`${prData.data.title}\n\n${prData.data.body}`, pr.owner, pr.repo) + if (!commit.note) { + commit.note = prParsed.note + } + if (!commit.type || prParsed.type === 'breaking-change') { + commit.type = prParsed.type + } prSubject = prSubject || prParsed.subject pr = prParsed.pr && (prParsed.pr.number !== pr.number) ? prParsed.pr : null