Merge pull request #16900 from Homebrew/github-fix

utils/github: fix variable scope
This commit is contained in:
Bo Anderson 2024-03-16 03:39:15 +00:00 committed by GitHub
commit 2d3183c84e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -606,7 +606,6 @@ module GitHub
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 @@ module GitHub
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