Skip to content

Commit 1e50d85

Browse files
copeusclaude
andcommitted
fix(release): the auto-title was the CHANGELOG's date, not a name
The heading is `## [X.Y.Z] - YYYY-MM-DD`, so the suffix after the dash is the date. v3.0.6 and v3.1.0 both shipped titled "vX.Y.Z — 2026-09-02" — the first two releases the fixed gate published on its own, and the first two where nobody passed --title by hand. The title now comes from the entry's first `###` heading, which is where a release actually names itself, and falls back to no suffix rather than to a date. Both existing releases retitled. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 7d2caa9 commit 1e50d85

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,23 @@ jobs:
7070
body += "\n\nFull detail in the [CHANGELOG](https://github.com/${{ github.repository }}/blob/main/CHANGELOG.md)."
7171
with open("_release_notes.md", "w", encoding="utf-8") as fh:
7272
fh.write(body)
73-
# a short human title line from the CHANGELOG heading, if any
73+
# A short human title. The CHANGELOG heading is `## [X.Y.Z] - YYYY-MM-DD`, so
74+
# what follows the dash is the DATE, not a name — v3.0.6 and v3.1.0 both shipped
75+
# titled "vX.Y.Z — 2026-09-02" before this was noticed. Take the first `### `
76+
# heading of the body instead, which is where the release actually names itself,
77+
# and fall back to no suffix rather than to a date.
7478
m = re.search(r'(?m)^## \[?%s\]?\s*(?:[—-]\s*(.*))?$' % re.escape(v), cl)
7579
title_suffix = (m.group(1).strip() if m and m.group(1) else "").strip()
80+
if re.fullmatch(r'\d{4}-\d{2}-\d{2}', title_suffix or ""):
81+
title_suffix = ""
82+
if not title_suffix:
83+
h = re.search(r'(?m)^###\s+(.+?)\s*$', body)
84+
if h:
85+
# "Fixed — a two-line change no longer runs twenty thousand tests"
86+
# reads better as the half after the dash.
87+
t = h.group(1).strip()
88+
parts = re.split(r'\s+[—-]\s+', t, maxsplit=1)
89+
title_suffix = (parts[1] if len(parts) > 1 else t).strip()[:80]
7690
with open(os.environ["GITHUB_OUTPUT"], "a") as fh:
7791
fh.write("title_suffix=%s\n" % title_suffix)
7892
print("Extracted %d chars of notes." % len(body))

0 commit comments

Comments
 (0)