Skip to content

Commit a0af80a

Browse files
authored
feat: update release note script to be flexible (#809)
1 parent 2a2d023 commit a0af80a

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

docs/release.md

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,20 +42,28 @@ $ git fetch upstream
4242
$ git log $(git describe --tags --abbrev=0 upstream/main)..upstream/main --pretty=format:"%h %s" |
4343
gawk '
4444
{
45-
# Extract the commit message without the hash and ticket prefix
46-
# Pattern: hash + space + [ticket] + space + type + ":"
47-
# Example: "a1b2c3d [PROJ-123] feat: some message"
45+
hash = $1
46+
msg = substr($0, index($0, $2))
4847
49-
# Remove the hash and space
50-
msg = substr($0, index($0,$2))
48+
# Skip merge commits (no real code changes)
49+
if (msg ~ /^Merge pull request/) {
50+
next
51+
}
52+
53+
# Remove [TICKET] brackets → TICKET
54+
gsub(/\[([A-Za-z0-9_-]+)\]/, "\\1", msg)
5155
52-
# Regex to extract type: after "] " followed by letters, colon
53-
if (match(msg, /\] *([a-z]+):/, m)) {
54-
type = m[1]
55-
groups[type] = groups[type] "\n- " $0
56+
# Detect type (feat, fix, chore, etc.)
57+
if (match(msg, /(^|\s)([a-z]+)(\([^)]*\))?:/, m)) {
58+
type = m[2]
59+
} else if (msg ~ /^Bump / || msg ~ / bump /) {
60+
# Bot-style dependency bumps → Chore
61+
type = "chore"
5662
} else {
57-
groups["others"] = groups["others"] "\n- " $0
63+
type = "others"
5864
}
65+
66+
groups[type] = groups[type] "\n- " hash " " msg
5967
}
6068
END {
6169
order = "feat fix chore docs test others"

0 commit comments

Comments
 (0)