Skip to content

Commit

Permalink
Merge pull request #6294 from nilsvu/fix_release_notes
Browse files Browse the repository at this point in the history
Fix release notes for empty PR description
  • Loading branch information
nilsdeppe authored Sep 24, 2024
2 parents 785d70c + e300b14 commit 9f9dc2c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/tools/Test_CompileReleaseNotes.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ def test_get_upgrade_instructions(self):
"Do this and that.",
"Not all whitespace is stripped",
)
self.assertIsNone(get_upgrade_instructions(""))
self.assertIsNone(get_upgrade_instructions(None))

def test_compile_release_notes(self):
self.assertEqual(
Expand Down
2 changes: 2 additions & 0 deletions tools/CompileReleaseNotes.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ def get_upgrade_instructions(pr_description: str) -> Optional[str]:
<!-- UPGRADE INSTRUCTIONS -->
```
"""
if not pr_description:
return None
FENCE_PATTERN = "<!-- UPGRADE INSTRUCTIONS -->"
match = re.search(
FENCE_PATTERN + "(.*)" + FENCE_PATTERN, pr_description, flags=re.DOTALL
Expand Down

0 comments on commit 9f9dc2c

Please sign in to comment.