Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions .github/scripts/group-release-notes.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,16 @@


def classify(subject):
"""Return `(section_key, cleaned_subject)` for a commit subject line."""
"""Return the `section_key` for a commit subject line.

Only the type is parsed off, for bucketing; the subject itself is kept
verbatim (prefix included) by the caller so the rendered notes still
show the `feat:` / `fix:` convention.
"""
match = COMMIT_RE.match(subject)
if match and match.group("type") in SECTION_TITLES:
return match.group("type"), match.group("subject").strip()
return OTHER_KEY, subject.strip()
return match.group("type")
return OTHER_KEY


def main():
Expand All @@ -51,8 +56,8 @@ def main():
if not line:
continue
short_hash, _, subject = line.partition("\t")
key, cleaned = classify(subject)
buckets.setdefault(key, []).append((short_hash, cleaned))
key = classify(subject)
buckets.setdefault(key, []).append((short_hash, subject.strip()))

new_tag = os.environ.get("NEW_TAG", "")
prev_tag = os.environ.get("PREV_TAG", "")
Expand Down
Loading