Skip to content
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

Merged
merged 1 commit into from Mar 21, 2024

Conversation

john-kurkowski
Copy link
Owner

Only omit the first paragraph, "What's Changed." Keep the e.g. "New Contributors" paragraph and "Full Changelog" link.

Only omit the first paragraph, "What's Changed." Keep the e.g. "New Contributors" paragraph.
@john-kurkowski
Copy link
Owner Author

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}.",
Copy link
Owner Author

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.

Copy link
Contributor

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:])
Copy link
Contributor

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.

@john-kurkowski john-kurkowski merged commit 1d40c76 into master Mar 21, 2024
27 checks passed
@john-kurkowski john-kurkowski deleted the new-contributors-in-release branch March 21, 2024 01:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants