Skip to content

Commit 5647725

Browse files
committed
stop clipping the last word off short release titles
The release-title derivation word-clipped even when the changelog headline was already under 80 chars: first_line[:80] returned the whole string, then rfind chopped the final word. v0.7.1 shipped as "...add test" instead of "...add test coverage". Only word-clip when the line actually exceeds 80.
1 parent c41066f commit 5647725

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,15 +143,17 @@ jobs:
143143
144144
# Title clipping. GitHub's release-name field truncates around 100 chars;
145145
# blind [:80] cuts mid-word (v0.6.0 shipped with title ending "...and fresh").
146-
# Prefer the first sentence boundary; fall back to a word-boundary clip near
147-
# 80 chars and strip dangling punctuation. Empty CHANGELOG falls back to
148-
# "vX.Y.Z" with no suffix.
146+
# Prefer the first sentence boundary; only word-boundary-clip when the line
147+
# actually exceeds 80 chars (a shorter line is used whole, minus dangling
148+
# punctuation). Empty CHANGELOG falls back to "vX.Y.Z" with no suffix.
149149
if not first_line:
150150
title = f"v{tag}"
151151
else:
152152
sentence_end = first_line.find(". ")
153153
if 0 < sentence_end <= 80:
154154
clipped = first_line[:sentence_end]
155+
elif len(first_line) <= 80:
156+
clipped = first_line.rstrip(".,;:\"' ")
155157
else:
156158
clipped = first_line[:80]
157159
last_space = clipped.rfind(" ")

0 commit comments

Comments
 (0)