Skip to content

Commit 1f08e11

Browse files
committed
ci(release): handle empty commit bodies in notes
1 parent 6be4dd9 commit 1f08e11

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,10 +211,17 @@ jobs:
211211
other = []
212212
213213
for record in raw.split("\x1e"):
214-
record = record.strip()
214+
# Do not use strip() here: Python treats ASCII unit separator
215+
# (\x1f) as whitespace, so commits with an empty body would lose
216+
# the trailing field separator and fail to unpack.
217+
record = record.strip("\r\n")
215218
if not record:
216219
continue
217-
sha, subject, body = record.split("\x1f", 2)
220+
parts = record.split("\x1f", 2)
221+
if len(parts) < 2:
222+
continue
223+
sha, subject = parts[:2]
224+
body = parts[2] if len(parts) > 2 else ""
218225
if bump_re.match(subject):
219226
continue
220227

0 commit comments

Comments
 (0)