utils/github: fix variable scope

This commit is contained in:
Bo Anderson 2024-03-16 03:25:44 +00:00
parent 8102e239f9
commit e6f64767c5
No known key found for this signature in database

View File

@ -606,7 +606,6 @@ module GitHub
EOS EOS
owner, repo = tap_remote_repo.split("/") owner, repo = tap_remote_repo.split("/")
variables = { owner:, repo:, states: ["OPEN"] } variables = { owner:, repo:, states: ["OPEN"] }
regex = pull_request_title_regex(name, version)
pull_requests = [] pull_requests = []
API.paginate_graphql(query, variables:) do |result| API.paginate_graphql(query, variables:) do |result|
@ -617,6 +616,7 @@ module GitHub
pull_requests pull_requests
end end
regex = pull_request_title_regex(name, version)
@open_pull_requests[cache_key].select { |pr| regex.match?(pr["title"]) } @open_pull_requests[cache_key].select { |pr| regex.match?(pr["title"]) }
.map { |pr| pr.merge("html_url" => pr.delete("url")) } .map { |pr| pr.merge("html_url" => pr.delete("url")) }
rescue API::RateLimitExceededError => e rescue API::RateLimitExceededError => e