Module: Octokit::Client::Checks
- Included in:
- Octokit::Client
- Defined in:
- lib/octokit/client/checks.rb
Overview
Methods for the Checks API
Instance Method Summary collapse
-
#check_run(repo, id, options = {}) ⇒ Sawyer::Resource
Get a single check run.
-
#check_run_annotations(repo, id, options = {}) ⇒ Array<Sawyer::Resource>
List annotations for a check run.
-
#check_runs_for_check_suite(repo, id, options = {}) ⇒ Sawyer::Resource
(also: #list_check_runs_for_check_suite)
List check runs in a check suite.
-
#check_runs_for_ref(repo, ref, options = {}) ⇒ Sawyer::Resource
(also: #list_check_runs_for_ref)
List check runs for a specific ref.
-
#check_suite(repo, id, options = {}) ⇒ Sawyer::Resource
Get a single check suite.
-
#check_suites_for_ref(repo, ref, options = {}) ⇒ Sawyer::Resource
(also: #list_check_suites_for_ref)
List check suites for a specific ref.
-
#create_check_run(repo, name, head_sha, options = {}) ⇒ Sawyer::Resource
Create a check run.
-
#create_check_suite(repo, head_sha, options = {}) ⇒ Sawyer::Resource
Create a check suite.
-
#rerequest_check_suite(repo, id, options = {}) ⇒ Boolean
Rerequest check suite.
-
#set_check_suite_preferences(repo, options = {}) ⇒ Sawyer::Resource
Set preferences for check suites on a repository.
-
#update_check_run(repo, id, options = {}) ⇒ Sawyer::Resource
Update a check run.
Instance Method Details
#check_run(repo, id, options = {}) ⇒ Sawyer::Resource
Get a single check run
100 101 102 |
# File 'lib/octokit/client/checks.rb', line 100 def check_run(repo, id, = {}) get "#{Repository.path repo}/check-runs/#{id}", end |
#check_run_annotations(repo, id, options = {}) ⇒ Array<Sawyer::Resource>
List annotations for a check run
115 116 117 |
# File 'lib/octokit/client/checks.rb', line 115 def check_run_annotations(repo, id, = {}) paginate "#{Repository.path repo}/check-runs/#{id}/annotations", end |
#check_runs_for_check_suite(repo, id, options = {}) ⇒ Sawyer::Resource Also known as: list_check_runs_for_check_suite
List check runs in a check suite
86 87 88 89 90 91 |
# File 'lib/octokit/client/checks.rb', line 86 def check_runs_for_check_suite(repo, id, = {}) paginate "#{Repository.path repo}/check-suites/#{id}/check-runs", do |data, last_response| data.check_runs.concat last_response.data.check_runs data.total_count += last_response.data.total_count end end |
#check_runs_for_ref(repo, ref, options = {}) ⇒ Sawyer::Resource Also known as: list_check_runs_for_ref
List check runs for a specific ref
62 63 64 65 66 67 |
# File 'lib/octokit/client/checks.rb', line 62 def check_runs_for_ref(repo, ref, = {}) paginate "#{Repository.path repo}/commits/#{ref}/check-runs", do |data, last_response| data.check_runs.concat last_response.data.check_runs data.total_count += last_response.data.total_count end end |
#check_suite(repo, id, options = {}) ⇒ Sawyer::Resource
Get a single check suite
129 130 131 |
# File 'lib/octokit/client/checks.rb', line 129 def check_suite(repo, id, = {}) get "#{Repository.path repo}/check-suites/#{id}", end |
#check_suites_for_ref(repo, ref, options = {}) ⇒ Sawyer::Resource Also known as: list_check_suites_for_ref
List check suites for a specific ref
148 149 150 151 152 153 |
# File 'lib/octokit/client/checks.rb', line 148 def check_suites_for_ref(repo, ref, = {}) paginate "#{Repository.path repo}/commits/#{ref}/check-suites", do |data, last_response| data.check_suites.concat last_response.data.check_suites data.total_count += last_response.data.total_count end end |
#create_check_run(repo, name, head_sha, options = {}) ⇒ Sawyer::Resource
Create a check run
25 26 27 28 29 30 |
# File 'lib/octokit/client/checks.rb', line 25 def create_check_run(repo, name, head_sha, = {}) [:name] = name [:head_sha] = head_sha post "#{Repository.path repo}/check-runs", end |
#create_check_suite(repo, head_sha, options = {}) ⇒ Sawyer::Resource
Create a check suite
182 183 184 185 186 |
# File 'lib/octokit/client/checks.rb', line 182 def create_check_suite(repo, head_sha, = {}) [:head_sha] = head_sha post "#{Repository.path repo}/check-suites", end |
#rerequest_check_suite(repo, id, options = {}) ⇒ Boolean
Rerequest check suite
194 195 196 197 |
# File 'lib/octokit/client/checks.rb', line 194 def rerequest_check_suite(repo, id, = {}) post "#{Repository.path repo}/check-suites/#{id}/rerequest", true end |
#set_check_suite_preferences(repo, options = {}) ⇒ Sawyer::Resource
Set preferences for check suites on a repository
168 169 170 |
# File 'lib/octokit/client/checks.rb', line 168 def set_check_suite_preferences(repo, = {}) patch "#{Repository.path repo}/check-suites/preferences", end |
#update_check_run(repo, id, options = {}) ⇒ Sawyer::Resource
Update a check run
42 43 44 |
# File 'lib/octokit/client/checks.rb', line 42 def update_check_run(repo, id, = {}) patch "#{Repository.path repo}/check-runs/#{id}", end |