bump-formula-pr: add release notes if found

This commit is contained in:
Sean Molenaar 2023-03-07 19:41:40 +01:00
parent bd309509da
commit 139f90df97
No known key found for this signature in database
GPG Key ID: AAC1C7E1A4696A9A

View File

@ -346,6 +346,24 @@ module Homebrew
EOS
end
if new_url =~ %r{^https://github.com/([\w-]+)/([\w-]+)/archive/refs/tags/(v?[.0-9]*)\.tar}
owner = Regexp.last_match(1)
repo = Regexp.last_match(2)
tag = Regexp.last_match(3)
github_release_data = begin
GitHub::API.open_rest("#{GitHub::API_URL}/repos/#{owner}/#{repo}/releases/tags/#{tag}")
rescue GitHub::API::HTTPNotFoundError
nil
end
pr_message += <<~EOS if github_release_data.present?
<details>
<summary>#{github_release_data["prerelease"] ? "pre" : ""}release notes</summary>
#{github_release_data["body"]}
</details>
EOS
end
pr_info = {
sourcefile_path: formula.path,
old_contents: old_contents,