From a4a79eaa8cdf39f35dcd1753b973e830ff7b00b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Wed, 30 Dec 2020 20:02:24 +0100 Subject: [PATCH] fix(changelog): remove CR characters in breaking change messages The GitHub UI might not remove CR characters from commit description forms filled from a Windows browser. --- tools/changelog.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/changelog.sh b/tools/changelog.sh index 8753212e9..634b61d01 100755 --- a/tools/changelog.sh +++ b/tools/changelog.sh @@ -91,6 +91,8 @@ function parse-commit { if [[ "$body" =~ "BREAKING CHANGE: (.*)" || \ "$subject" =~ '^[^ :\)]+\)?!: (.*)$' ]]; then message="${match[1]}" + # remove CR characters (might be inserted in GitHub UI commit description form) + message="${message//$'\r'/}" # skip next paragraphs (separated by two newlines or more) message="${message%%$'\n\n'*}" # ... and replace newlines with spaces