From 54c72a9304cdccb31463be451f813850758b42f4 Mon Sep 17 00:00:00 2001 From: Amigo Date: Fri, 12 Jun 2026 12:18:48 -0500 Subject: [PATCH] fix(changelog): fix handling of whitespace commit bodies in changelog template filter --- src/semantic_release/changelog/context.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/semantic_release/changelog/context.py b/src/semantic_release/changelog/context.py index 563f6a3f4..202b2c373 100644 --- a/src/semantic_release/changelog/context.py +++ b/src/semantic_release/changelog/context.py @@ -169,6 +169,11 @@ def autofit_text_width(text: str, maxwidth: int = 100, indent_size: int = 0) -> ) ) + # Guard against empty paragraphs (e.g. from whitespace-only lines in commit bodies), + # which would cause words[0] to raise an IndexError. + if not words: + continue + # Initialize the line for each paragraph line = words[0] next_line = ""