From c0548668548da20f4fe9187e741e40dcf40dc2a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Jorge=20Lopes?= Date: Wed, 10 Jun 2026 11:55:35 +0100 Subject: [PATCH] fix(release): use first non-empty line as commit subject in parser MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git log --format=%B%x00 separates records with a newline, so every commit after the newest carried a leading blank line and head -1 returned an empty subject — misclassifying it as "other". A range with a feat behind the newest commit then bumped as patch instead of minor (v0.2.2 should have been minor). Fix: take the first non-empty line via awk. Co-Authored-By: Claude Opus 4.7 --- lib/release.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/release.sh b/lib/release.sh index e62e911..cad1fe1 100644 --- a/lib/release.sh +++ b/lib/release.sh @@ -56,7 +56,11 @@ _parse_conventional_commits() { while IFS= read -r -d '' commit_block; do [[ -z "$commit_block" ]] && continue local subject - subject="$(echo "$commit_block" | head -1)" + # The subject is the first NON-EMPTY line. git log --format='%B%x00' + # separates records with a newline, so every commit after the newest carries + # a leading blank line — `head -1` would return "" and misclassify it as + # "other" (this silently bumped a feat-containing range as patch, not minor). + subject="$(echo "$commit_block" | awk 'NF{print; exit}')" # Check for breaking changes (major) if [[ "$subject" == *"!"*":"* ]] || echo "$commit_block" | grep -q "^BREAKING CHANGE:"; then