exceptions: skip #fetch_issues is HOMEBREW_NO_BUILD_ERROR_ISSUES is set

This will allow us to set `HOMEBREW_NO_BUILD_ERROR_ISSUES` in our
workflows, which will avoid needlessly burning through our rate limit.
This commit is contained in:
Carlo Cabrera 2024-09-12 14:05:30 +08:00
parent 0fb4d515e5
commit a4b433895c
No known key found for this signature in database
GPG Key ID: C74D447FC549A1D0

View File

@ -495,6 +495,8 @@ class BuildError < RuntimeError
sig { returns(T::Array[T.untyped]) }
def fetch_issues
return [] if ENV["HOMEBREW_NO_BUILD_ERROR_ISSUES"].present?
GitHub.issues_for_formula(formula.name, tap: formula.tap, state: "open", type: "issue")
rescue GitHub::API::Error => e
opoo "Unable to query GitHub for recent issues on the tap\n#{e.message}"