c7bb88f9ad3eb742aecca2e36b615819cead10f4

Author
Marc Cornellà <hello@mcornella.com>
Committer
Marc Cornellà <hello@mcornella.com>
Date

Message

fix(changelog): ignore lines containing whitespace in breaking change commits

Diff

 1diff --git a/tools/changelog.sh b/tools/changelog.sh
 2index 5f7a14d03f5380aaf1b1aa95c26ee014b9d041f0..1af74e42d74080f468a066ddec98ab18367630a2 100755
 3--- a/tools/changelog.sh
 4+++ b/tools/changelog.sh
 5@@ -106,6 +106,9 @@ function parse-commit {
 6       message="${match[1]}"
 7       # remove CR characters (might be inserted in GitHub UI commit description form)
 8       message="${message//$'\r'/}"
 9+      # remove lines containing only whitespace
10+      local nlnl=$'\n\n'
11+      message="${message//$'\n'[[:space:]]##$'\n'/$nlnl}"
12       # skip next paragraphs (separated by two newlines or more)
13       message="${message%%$'\n\n'*}"
14       # ... and replace newlines with spaces