-
-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Keep more of GitHub release notes body #327
Conversation
Only omit the first paragraph, "What's Changed." Keep the e.g. "New Contributors" paragraph.
FYI @ekcorso |
@@ -131,25 +124,15 @@ def get_changelog_release_notes(release_notes_url: str, version: str) -> str: | |||
if match: | |||
return str(match.group(1)).strip() | |||
else: | |||
print( | |||
f"WARNING: Failed to parse changelog release notes. Manually copy this version's notes from the CHANGELOG.md file to {release_notes_url}.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't tripped on this error handler yet, but I think the URL in it was wrong. It's a compare link like 5.1.1...5.1.2, not a create-release link. I moved this error print to after we have the release link.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, good point. I think I garbled this warning when I added the release_notes_url
. Your new placement is correct: it should be directing the user to the url of the newly created draft release to manually add the notes. Thanks for catching this!
return "" | ||
body = str(response.json()["body"]) | ||
paragraphs = body.split("\n\n") | ||
return "\n\n".join(paragraphs[1:]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So concise and it got rid of the REGEX-- love it. Still a little brittle if this format changes, but I think this is a great improvement.
Only omit the first paragraph, "What's Changed." Keep the e.g. "New Contributors" paragraph and "Full Changelog" link.