浏览代码

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

Marc Cornellà 2 年之前
父节点
当前提交
c7bb88f9ad
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      tools/changelog.sh

+ 3 - 0
tools/changelog.sh

@@ -106,6 +106,9 @@ function parse-commit {
       message="${match[1]}"
       # remove CR characters (might be inserted in GitHub UI commit description form)
       message="${message//$'\r'/}"
+      # remove lines containing only whitespace
+      local nlnl=$'\n\n'
+      message="${message//$'\n'[[:space:]]##$'\n'/$nlnl}"
       # skip next paragraphs (separated by two newlines or more)
       message="${message%%$'\n\n'*}"
       # ... and replace newlines with spaces