diff --git a/Library/Homebrew/utils/github.rb b/Library/Homebrew/utils/github.rb index 641f42bf2459a..795cb17e8adde 100644 --- a/Library/Homebrew/utils/github.rb +++ b/Library/Homebrew/utils/github.rb @@ -606,7 +606,6 @@ def self.fetch_open_pull_requests(name, tap_remote_repo, version: nil) EOS owner, repo = tap_remote_repo.split("/") variables = { owner:, repo:, states: ["OPEN"] } - regex = pull_request_title_regex(name, version) pull_requests = [] API.paginate_graphql(query, variables:) do |result| @@ -617,6 +616,7 @@ def self.fetch_open_pull_requests(name, tap_remote_repo, version: nil) pull_requests end + regex = pull_request_title_regex(name, version) @open_pull_requests[cache_key].select { |pr| regex.match?(pr["title"]) } .map { |pr| pr.merge("html_url" => pr.delete("url")) } rescue API::RateLimitExceededError => e