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.
This commit is contained in:
Matt Coster 2025-07-16 09:43:31 +01:00
parent 3fa656a8d1
commit 41fce10dde
No known key found for this signature in database
GPG Key ID: ADB732650474F2DA

View File

@ -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