diff --git a/.github/scripts/release_notes_by_component.py b/.github/scripts/release_notes_by_component.py index 39c60479e8..c1ba38a127 100644 --- a/.github/scripts/release_notes_by_component.py +++ b/.github/scripts/release_notes_by_component.py @@ -211,7 +211,7 @@ def split_notes(body): end = next((i for i in range(start + 1, len(lines)) if lines[i].startswith(("## ", "**Full Changelog**"))), len(lines)) prs, stray = [], [] - block = [l.strip() for l in lines[start + 1:end] if l.strip()] + block = [l.rstrip() for l in lines[start + 1:end] if l.strip()] for line in lines[start + 1:end]: if PR_LINE.match(line): prs.append(line) diff --git a/.github/scripts/test_release_notes_by_component.py b/.github/scripts/test_release_notes_by_component.py index a969e47492..ee542c6a7a 100644 --- a/.github/scripts/test_release_notes_by_component.py +++ b/.github/scripts/test_release_notes_by_component.py @@ -166,6 +166,9 @@ class RegroupTest(unittest.TestCase): def test_hand_written_component_heading_refused(self): with self.assertRaises(ValueError): rn.regroup(NOTES.replace("## What's Changed\n", "## What's Changed\n### Security\n"), self.files) + once = rn.regroup(NOTES, self.files) + with self.assertRaises(ValueError): + rn.regroup(once.replace("\n### Filer\n", "\n ### Filer\n"), self.files) def test_author_from_the_by_clause(self): body = "## What's Changed\n* Bump a by @dependabot[bot] in docs by @alice in https://github.com/seaweedfs/seaweedfs/pull/7\n"