From 8ef9ae51ba2d20a2c6b97b287e6ec610a53cce3d Mon Sep 17 00:00:00 2001 From: Aaruni Kaushik Date: Wed, 4 Feb 2026 20:42:28 +0100 Subject: [PATCH] Print a useful complaint instead of garbage when release notes section was not found in release notes: use body --- release-notes.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/release-notes.py b/release-notes.py index d51899c..5136f4d 100644 --- a/release-notes.py +++ b/release-notes.py @@ -176,7 +176,11 @@ def body_to_release_notes(pr): ## not found ## complain and return fallback print(f"Release notes section not found in PR number {pr['number']}!!") - return body + return ( + f"PR number {pr['number']} appears not to have a release notes section! Please check" + "that the body containes a second level heading (starting with `##`) named `Release " + "notes`, and have the entries as lists." + ) index2 = body.find('\n', index1) + 1 # the first line after the release notes line bodylines = body[index2:].splitlines() mdstring = ""