From 81c0ab195f8e9cbe3f3e6cfcde346e0034e610df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Jorge=20Lopes?= Date: Wed, 10 Jun 2026 11:51:23 +0100 Subject: [PATCH] fix(release): honor skip-release marker only in subject/trailer, not prose MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit _parse_conventional_commits grepped the ENTIRE HEAD commit body for the skip-release marker, so a commit whose prose merely mentioned that marker (e.g. one explaining the release logic) skipped its own release. PR #38's feat commit did exactly that and was silently skipped — no v0.3.0 was cut. Now the marker is honored only when it appears in the subject line or as a standalone trailer line. Subject and trailer skips still work; mid-sentence mentions no longer trigger a skip. Co-Authored-By: Claude Opus 4.7 --- lib/release.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/release.sh b/lib/release.sh index f8614b1..e62e911 100644 --- a/lib/release.sh +++ b/lib/release.sh @@ -31,10 +31,15 @@ _parse_conventional_commits() { return 0 fi - # Check for [skip release] in the HEAD commit only (not the entire range) - local head_msg + # Honor the skip-release marker on the HEAD commit only — and ONLY when it + # appears in the subject line or as a standalone trailer line, NOT mid-prose. + # (A commit whose body merely mentions the marker while explaining the release + # logic must not skip its own release — that footgun silently skipped PR #38.) + local head_msg head_subject head_msg="$(git -C "$project_dir" log -1 --format='%B' 2>/dev/null || echo "")" - if echo "$head_msg" | grep -qi '\[skip release\]'; then + head_subject="$(echo "$head_msg" | head -1)" + if echo "$head_subject" | grep -qiF '[skip release]' \ + || echo "$head_msg" | grep -qiE '^[[:space:]]*\[skip release\][[:space:]]*$'; then echo "none" return 0 fi