Merge pull request #14770 from issyl0/smarter-pagination

This commit is contained in:
Issy Long 2023-02-22 19:35:42 +00:00 committed by GitHub
commit bfff981f1a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -256,6 +256,8 @@ module GitHub
def paginate_rest(url, additional_query_params: nil, per_page: 100)
(1..API_MAX_PAGES).each do |page|
result = API.open_rest("#{url}?per_page=#{per_page}&page=#{page}&#{additional_query_params}")
break if result.blank?
yield(result, page)
end
end