浏览代码

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.
Marc Cornellà 3 年之前
父节点
当前提交
a4a79eaa8c
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      tools/changelog.sh

+ 2 - 0
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