From ee988956bb828f959835dd80b26acd6555c0a359 Mon Sep 17 00:00:00 2001 From: felixzsh Date: Mon, 24 Aug 2026 14:26:50 -0500 Subject: [PATCH] ci: detect scoped conventional commits and fix changelog range Workflow missed commits like fix(security): ... because git log --pretty=format:"%H %s" without trailing newline truncated the last commit in RANGE (v1.8.0..HEAD), causing "No relevant conventional commits" for v1.8.1. Switch to --format="%H %s" which handles newlines correctly and supports optional scope and breaking ! via regex ^(feat|fix)(\([^)]+\))?!?: --- .github/workflows/release.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ed3b248..0d33e96 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -44,11 +44,11 @@ jobs: [ -z "$line" ] && continue sha="${line%% *}" subject="${line#* }" - # match conventional commits: feat, fix (with optional scope) - if echo "$subject" | grep -qE '^(feat|fix)(\(.+\))?: '; then - type="$(echo "$subject" | sed -E 's/^([a-z]+)(\(.+\))?:.*/\1/')" + # match conventional commits: feat, fix (with optional scope and breaking !) + if echo "$subject" | grep -qE '^(feat|fix)(\([^)]+\))?!?: '; then + type="$(echo "$subject" | sed -E 's/^([a-z]+)(\([^)]+\))?!?:.*/\1/')" # strip type prefix for display, keep rest as title - title="$(echo "$subject" | sed -E 's/^[a-z]+(\(.+\))?: //')" + title="$(echo "$subject" | sed -E 's/^[a-z]+(\([^)]+\))?!?: //')" short="$(echo "$sha" | cut -c1-7)" url="https://github.com/${REPO}/commit/${sha}" entry="- ${title} ([\`${short}\`](${url}))" @@ -58,7 +58,7 @@ jobs: FIXES="${FIXES}${entry}"$'\n' fi fi - done < <(git log "$RANGE" --pretty=format:"%H %s" --no-merges) + done < <(git log "$RANGE" --format="%H %s" --no-merges) { echo "# ${TAG}"