module Octokit::Client::Checks

def check_run(repo, id, options = {})

Other tags:
    See: https://developer.github.com/v3/checks/runs/#get-a-single-check-run -

Returns:
  • (Sawyer::Resource) - A hash representing the check run

Parameters:
  • id (Integer) -- The ID of the check run
  • repo (Integer, String, Hash, Repository) -- A GitHub repository
def check_run(repo, id, options = {})
  get "#{Repository.path repo}/check-runs/#{id}", options
end

def check_run_annotations(repo, id, options = {})

Other tags:
    Example: List annotations for a check run -

Other tags:
    See: https://developer.github.com/v3/checks/runs/#list-annotations-for-a-check-run -

Returns:
  • (Array) - An array of hashes representing check run annotations

Parameters:
  • id (Integer) -- The ID of the check run
  • repo (Integer, String, Hash, Repository) -- A GitHub repository
def check_run_annotations(repo, id, options = {})
  paginate "#{Repository.path repo}/check-runs/#{id}/annotations", options
end

def check_runs_for_check_suite(repo, id, options = {})

Other tags:
    Example: List check runs in a check suite -

Other tags:
    See: https://developer.github.com/v3/checks/runs/#list-check-runs-in-a-check-suite -

Returns:
  • (Sawyer::Resource) - A hash representing a collection of check runs

Options Hash: (**options)
  • :filter (String) -- Filters check runs by their completed_at timestamp
  • :status (String) -- Returns check runs with the specified status
  • :check_name (String) -- Returns check runs with the specified name

Parameters:
  • options (Hash) -- A set of optional filters
  • id (Integer) -- The ID of the check suite
  • repo (Integer, String, Hash, Repository) -- A GitHub repository
def check_runs_for_check_suite(repo, id, options = {})
  paginate "#{Repository.path repo}/check-suites/#{id}/check-runs", options do |data, last_response|
    data.check_runs.concat last_response.data.check_runs
    data.total_count += last_response.data.total_count
  end
end

def check_runs_for_ref(repo, ref, options = {})

Other tags:
    Example: List check runs for a specific ref -

Other tags:
    See: https://developer.github.com/v3/checks/runs/#list-check-runs-for-a-specific-ref -

Returns:
  • (Sawyer::Resource) - A hash representing a collection of check runs

Options Hash: (**options)
  • :filter (String) -- Filters check runs by their completed_at timestamp
  • :status (String) -- Returns check runs with the specified status
  • :check_name (String) -- Returns check runs with the specified name

Parameters:
  • options (Hash) -- A set of optional filters
  • ref (String) -- A SHA, branch name, or tag name
  • repo (Integer, String, Hash, Repository) -- A GitHub repository
def check_runs_for_ref(repo, ref, options = {})
  paginate "#{Repository.path repo}/commits/#{ref}/check-runs", options do |data, last_response|
    data.check_runs.concat last_response.data.check_runs
    data.total_count += last_response.data.total_count
  end
end

def check_suite(repo, id, options = {})

Other tags:
    See: https://developer.github.com/v3/checks/suites/#get-a-single-check-suite -

Returns:
  • (Sawyer::Resource) - A hash representing the check suite

Parameters:
  • id (Integer) -- The ID of the check suite
  • repo (Integer, String, Hash, Repository) -- A GitHub repository
def check_suite(repo, id, options = {})
  get "#{Repository.path repo}/check-suites/#{id}", options
end

def check_suites_for_ref(repo, ref, options = {})

Other tags:
    Example: List check suites for a specific ref -

Other tags:
    See: https://developer.github.com/v3/checks/suites/#list-check-suites-for-a-specific-ref -

Returns:
  • (Sawyer::Resource) - A hash representing a collection of check suites

Options Hash: (**options)
  • :check_name (String) -- Filters checks suites by the name of the check run
  • :app_id (Integer) -- Filters check suites by GitHub App id

Parameters:
  • options (Hash) -- A set of optional filters
  • ref (String) -- A SHA, branch name, or tag name
  • repo (Integer, String, Hash, Repository) -- A GitHub repository
def check_suites_for_ref(repo, ref, options = {})
  paginate "#{Repository.path repo}/commits/#{ref}/check-suites", options do |data, last_response|
    data.check_suites.concat last_response.data.check_suites
    data.total_count += last_response.data.total_count
  end
end

def create_check_run(repo, name, head_sha, options = {})

Other tags:
    Example: Create a check run -

Other tags:
    See: https://developer.github.com/v3/checks/runs/#create-a-check-run -

Returns:
  • (Sawyer::Resource) - A hash representing the new check run

Parameters:
  • head_sha (String) -- The SHA of the commit to check
  • name (String) -- The name of the check
  • repo (Integer, String, Hash, Repository) -- A GitHub repository
def create_check_run(repo, name, head_sha, options = {})
  options[:name] = name
  options[:head_sha] = head_sha
  post "#{Repository.path repo}/check-runs", options
end

def create_check_suite(repo, head_sha, options = {})

Other tags:
    Example: Create a check suite -

Other tags:
    See: https://developer.github.com/v3/checks/suites/#create-a-check-suite -

Returns:
  • (Sawyer::Resource) - A hash representing the new check suite

Parameters:
  • head_sha (String) -- The SHA of the commit to check
  • repo (Integer, String, Hash, Repository) -- A GitHub repository
def create_check_suite(repo, head_sha, options = {})
  options[:head_sha] = head_sha
  post "#{Repository.path repo}/check-suites", options
end

def rerequest_check_suite(repo, id, options = {})

Other tags:
    See: https://developer.github.com/v3/checks/suites/#rerequest-check-suite -

Returns:
  • (Boolean) - True if successful, raises an error otherwise

Parameters:
  • id (Integer) -- The ID of the check suite
  • repo (Integer, String, Hash, Repository) -- A GitHub repository
def rerequest_check_suite(repo, id, options = {})
  post "#{Repository.path repo}/check-suites/#{id}/rerequest", options
  true
end

def set_check_suite_preferences(repo, options = {})

Other tags:
    Example: Set preferences for check suites on a repository -

Other tags:
    See: https://developer.github.com/v3/checks/suites/#set-preferences-for-check-suites-on-a-repository -

Returns:
  • (Sawyer::Resource) - A hash representing the repository's check suite preferences

Parameters:
  • options (Hash) -- Preferences to set
  • repo (Integer, String, Hash, Repository) -- A GitHub repository
def set_check_suite_preferences(repo, options = {})
  patch "#{Repository.path repo}/check-suites/preferences", options
end

def update_check_run(repo, id, options = {})

Other tags:
    Example: Update a check run -

Other tags:
    See: https://developer.github.com/v3/checks/runs/#update-a-check-run -

Returns:
  • (Sawyer::Resource) - A hash representing the updated check run

Parameters:
  • id (Integer) -- The ID of the check run
  • repo (Integer, String, Hash, Repository) -- A GitHub repository
def update_check_run(repo, id, options = {})
  patch "#{Repository.path repo}/check-runs/#{id}", options
end