From a4b433895cecacfc9e5dd43d4e5ff0c8ff04e0b1 Mon Sep 17 00:00:00 2001 From: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> Date: Thu, 12 Sep 2024 14:05:30 +0800 Subject: [PATCH] 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. --- Library/Homebrew/exceptions.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Library/Homebrew/exceptions.rb b/Library/Homebrew/exceptions.rb index 95e97298d5..7c55f0172a 100644 --- a/Library/Homebrew/exceptions.rb +++ b/Library/Homebrew/exceptions.rb @@ -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}"