diff --git a/scripts/bumpminor.sh b/scripts/bumpminor.sh index c4bf03d..060cf8d 100755 --- a/scripts/bumpminor.sh +++ b/scripts/bumpminor.sh @@ -9,8 +9,10 @@ sed -i".bak" "s/\*\*Package:\*\* \`hbd\` v[0-9.]*/\*\*Package:\*\* \`hbd\` v$VE # Update CHANGELOG.md with commits since last tag LASTTAG=$(git describe --tags --abbrev=0 2>/dev/null || true) -ADDED=$(git log "${LASTTAG:+$LASTTAG..}HEAD" --pretty="%s" | grep "^feat:" | sed 's/^feat: /- /') -FIXED=$(git log "${LASTTAG:+$LASTTAG..}HEAD" --pretty="%s" | grep "^fix:" | sed 's/^fix: /- /') +# Matches both unscoped ("feat: ...") and scoped ("feat(server): ...") conventional-commit +# subjects; the scope is dropped from the changelog line. +ADDED=$(git log "${LASTTAG:+$LASTTAG..}HEAD" --pretty="%s" | grep -E "^feat(\([^)]*\))?:" | sed -E 's/^feat(\([^)]*\))?: /- /') +FIXED=$(git log "${LASTTAG:+$LASTTAG..}HEAD" --pretty="%s" | grep -E "^fix(\([^)]*\))?:" | sed -E 's/^fix(\([^)]*\))?: /- /') { printf "## [%s]\n" "$VER" [ -n "$ADDED" ] && printf "\n### Added\n%s\n" "$ADDED"