Skip to content

Commit 4267bde

Browse files
AbhiPrasadclaude
andauthored
chore: include conventional commit scope in release notes (#159)
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 <noreply@anthropic.com>
1 parent 0b717a9 commit 4267bde

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

.github/scripts/generate-release-notes.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,24 @@ else
4141
local type="$1"
4242
local msg="$2"
4343

44+
# Extract optional scope (e.g. "anthropic" from "fix(anthropic): foo")
45+
local scope
46+
scope=$(echo "$msg" | sed -En 's/^[a-zA-Z]+\(([^)]*)\):.*/\1/p')
47+
4448
# Strip the conventional commit prefix (e.g. "feat: ", "fix(scope): ")
4549
local display
4650
display=$(echo "$msg" | sed -E 's/^[a-zA-Z]+(\([^)]*\))?:[[:space:]]*//')
4751

4852
# Capitalize the first letter
4953
display="$(echo "${display:0:1}" | tr '[:lower:]' '[:upper:]')${display:1}"
5054

51-
# Label perf commits explicitly
52-
if [ "$type" = "perf" ]; then
55+
# Label perf commits explicitly, include scope if present
56+
if [ "$type" = "perf" ] && [ -n "$scope" ]; then
57+
display="(perf/${scope}) ${display}"
58+
elif [ "$type" = "perf" ]; then
5359
display="(perf) ${display}"
60+
elif [ -n "$scope" ]; then
61+
display="(${scope}) ${display}"
5462
fi
5563

5664
# Format PR link if present

0 commit comments

Comments
 (0)