Merge pull request #20187 from Homebrew/github-release-notes-link

dev-cmd/bump-formula-pr: release notes as proper html link
This commit is contained in:
Eric Knibbe 2025-06-28 00:14:45 +00:00 committed by GitHub
commit fe4f472c8d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -404,11 +404,14 @@ module Homebrew
# maximum length of PR body is 65,536 characters so let's truncate release notes to half of that. # maximum length of PR body is 65,536 characters so let's truncate release notes to half of that.
body = Formatter.truncate(github_release_data["body"], max: 32_768) body = Formatter.truncate(github_release_data["body"], max: 32_768)
# Ensure the URL is properly HTML encoded to handle any quotes or other special characters
html_url = CGI.escapeHTML(github_release_data["html_url"])
formula_pr_message += <<~XML formula_pr_message += <<~XML
<details> <details>
<summary>#{pre}release notes</summary> <summary>#{pre}release notes</summary>
<pre>#{body}</pre> <pre>#{body}</pre>
<p>View the full release notes at #{github_release_data["html_url"]}.</p> <p>View the full release notes at <a href="#{html_url}">#{html_url}</a>.</p>
</details> </details>
XML XML
end end