Skip to content

Commit

Permalink
Merge pull request #14918 from SMillerDev/master
Browse files Browse the repository at this point in the history
bump-formula-pr: add release notes if found
  • Loading branch information
MikeMcQuaid committed Mar 8, 2023
2 parents b6b3066 + 2f32da0 commit 8d71aa0
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Library/Homebrew/dev-cmd/bump-formula-pr.rb
Expand Up @@ -346,6 +346,28 @@ def bump_formula_pr
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
# If this is a 404: we can't do anything.
nil
end

if github_release_data.present?
pre = "pre" if github_release_data["prerelease"].present?
pr_message += <<~XML
<details>
<summary>#{pre}release notes</summary>
#{github_release_data["body"]}
</details>
XML
end
end

pr_info = {
sourcefile_path: formula.path,
old_contents: old_contents,
Expand Down

0 comments on commit 8d71aa0

Please sign in to comment.