Merge pull request #18155 from Homebrew/github-simplifications
utils/github: a few more simplifications
This commit is contained in:
commit
36a0e539e4
@ -910,15 +910,17 @@ module GitHub
|
|||||||
github_user = data.fetch("login")
|
github_user = data.fetch("login")
|
||||||
|
|
||||||
# BrewTestBot can open as many PRs as it wants.
|
# BrewTestBot can open as many PRs as it wants.
|
||||||
return false if github_user.casecmp("brewtestbot").zero?
|
return false if github_user.casecmp?("brewtestbot")
|
||||||
return false if data.dig("pullRequests", "totalCount") < MAXIMUM_OPEN_PRS
|
|
||||||
|
|
||||||
homebrew_prs_count += data.dig("pullRequests", "nodes").count do |node|
|
pull_requests = data.fetch("pullRequests")
|
||||||
|
return false if pull_requests.fetch("totalCount") < MAXIMUM_OPEN_PRS
|
||||||
|
|
||||||
|
homebrew_prs_count += pull_requests.fetch("nodes").count do |node|
|
||||||
node.dig("baseRepository", "owner", "login").casecmp?("homebrew")
|
node.dig("baseRepository", "owner", "login").casecmp?("homebrew")
|
||||||
end
|
end
|
||||||
return true if homebrew_prs_count >= MAXIMUM_OPEN_PRS
|
return true if homebrew_prs_count >= MAXIMUM_OPEN_PRS
|
||||||
|
|
||||||
data.dig("pullRequests", "pageInfo")
|
pull_requests.fetch("pageInfo")
|
||||||
end
|
end
|
||||||
|
|
||||||
false
|
false
|
||||||
|
Loading…
x
Reference in New Issue
Block a user