Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Paginate when retrieving check runs and check suites #1321

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions lib/octokit/client/checks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ def update_check_run(repo, id, options = {})
def check_runs_for_ref(repo, ref, options = {})
ensure_api_media_type(:checks, options)

get "#{Repository.path repo}/commits/#{ref}/check-runs", options
paginate "#{Repository.path repo}/commits/#{ref}/check-runs", options do |data, last_response|
data.check_runs.concat last_response.data.check_runs
end
end
alias :list_check_runs_for_ref :check_runs_for_ref

Expand All @@ -88,7 +90,9 @@ def check_runs_for_ref(repo, ref, options = {})
def check_runs_for_check_suite(repo, id, options = {})
ensure_api_media_type(:checks, options)

get "#{Repository.path repo}/check-suites/#{id}/check-runs", options
paginate "#{Repository.path repo}/check-suites/#{id}/check-runs", options do |data, last_response|
data.check_runs.concat last_response.data.check_runs
end
end
alias :list_check_runs_for_check_suite :check_runs_for_check_suite

Expand Down Expand Up @@ -155,7 +159,9 @@ def check_suite(repo, id, options = {})
def check_suites_for_ref(repo, ref, options = {})
ensure_api_media_type(:checks, options)

get "#{Repository.path repo}/commits/#{ref}/check-suites", options
paginate "#{Repository.path repo}/commits/#{ref}/check-suites", options do |data, last_response|
data.check_suites.concat last_response.data.check_suites
end
end
alias :list_check_suites_for_ref :check_suites_for_ref

Expand Down