Truncate long release notes in formula PR descriptions

- Some formula bumps have really long release notes which causes their
  bump PRs to exceed GitHub's 65k character limit for issue bodies.
This commit is contained in:
Issy Long 2025-05-21 12:45:47 +00:00 committed by GitHub
parent 8b32d019d4
commit 63cdd0723c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -399,10 +399,14 @@ module Homebrew
if github_release_data.present? if github_release_data.present?
pre = "pre" if github_release_data["prerelease"].present? pre = "pre" if github_release_data["prerelease"].present?
# maximum length of PR body is 65,536 characters so let's truncate release notes to half of that.
body = github_release_data["body"].truncate(32_768)
formula_pr_message += <<~XML formula_pr_message += <<~XML
<details> <details>
<summary>#{pre}release notes</summary> <summary>#{pre}release notes</summary>
<pre>#{github_release_data["body"]}</pre> <pre>#{body}</pre>
<p>View the full release notes at #{github_release_data["html_url"]}.</p>
</details> </details>
XML XML
end end