From d80b49c7c4d32e3d52ba9644eadfe9d6d898a089 Mon Sep 17 00:00:00 2001 From: Abhijeet Prasad Date: Thu, 26 Mar 2026 21:39:48 +0000 Subject: [PATCH] chore: include conventional commit scope in release notes Show the scope in changelog entries, e.g. `fix(anthropic): foo` becomes `(anthropic) Foo`. For perf commits with a scope, show both: `(perf/bt_json) Foo`. Co-Authored-By: Claude Sonnet 4.6 --- .github/scripts/generate-release-notes.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/scripts/generate-release-notes.sh b/.github/scripts/generate-release-notes.sh index 72274d4c..c568962b 100755 --- a/.github/scripts/generate-release-notes.sh +++ b/.github/scripts/generate-release-notes.sh @@ -41,6 +41,10 @@ else local type="$1" local msg="$2" + # Extract optional scope (e.g. "anthropic" from "fix(anthropic): foo") + local scope + scope=$(echo "$msg" | sed -En 's/^[a-zA-Z]+\(([^)]*)\):.*/\1/p') + # Strip the conventional commit prefix (e.g. "feat: ", "fix(scope): ") local display display=$(echo "$msg" | sed -E 's/^[a-zA-Z]+(\([^)]*\))?:[[:space:]]*//') @@ -48,9 +52,13 @@ else # Capitalize the first letter display="$(echo "${display:0:1}" | tr '[:lower:]' '[:upper:]')${display:1}" - # Label perf commits explicitly - if [ "$type" = "perf" ]; then + # Label perf commits explicitly, include scope if present + if [ "$type" = "perf" ] && [ -n "$scope" ]; then + display="(perf/${scope}) ${display}" + elif [ "$type" = "perf" ]; then display="(perf) ${display}" + elif [ -n "$scope" ]; then + display="(${scope}) ${display}" fi # Format PR link if present