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

bump-formula-pr: add release notes if found #14918

Merged
merged 5 commits into from Mar 8, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 18 additions & 0 deletions Library/Homebrew/dev-cmd/bump-formula-pr.rb
Expand Up @@ -346,6 +346,24 @@ def bump_formula_pr
EOS
end

if new_url =~ %r{^https://github.com/([\w-]+)/([\w-]+)/archive/refs/tags/(v?[.0-9]*)\.tar}
SMillerDev marked this conversation as resolved.
Show resolved Hide resolved
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
SMillerDev marked this conversation as resolved.
Show resolved Hide resolved
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
SMillerDev marked this conversation as resolved.
Show resolved Hide resolved
end

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