From 41fce10dde1fbee11543fe6c759a9a13cbbbdf08 Mon Sep 17 00:00:00 2001 From: Matt Coster Date: Wed, 16 Jul 2025 09:43:31 +0100 Subject: [PATCH] Ignore IP allow list errors in `too_many_open_prs` Fixes https://github.com/orgs/Homebrew/discussions/6263. Even when SAML passes, an IP allow list can still restrict access to organization repos. --- Library/Homebrew/utils/github.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/utils/github.rb b/Library/Homebrew/utils/github.rb index 6094117831..a2928de8a7 100644 --- a/Library/Homebrew/utils/github.rb +++ b/Library/Homebrew/utils/github.rb @@ -968,8 +968,12 @@ module GitHub pull_requests.fetch("pageInfo") end rescue => e - # Ignore SAML access errors (https://github.com/Homebrew/brew/issues/18610) - raise unless e.message.include?("Resource protected by organization SAML enforcement") + # Ignore SAML access errors (https://github.com/Homebrew/brew/issues/18610) and related + # IP allow list errors (https://github.com/orgs/Homebrew/discussions/6263) + return false if e.message.include?("Resource protected by organization SAML enforcement") || + e.message.include?("your IP address is not permitted to access this resource") + + raise end false