Method: Gitlab::Client::Commits#commit_status

Defined in:
lib/gitlab/client/commits.rb

#commit_status(project, sha, options = {}) ⇒ Object Also known as: repo_commit_status

Get the status of a commit

Examples:

Gitlab.commit_status(42, '6104942438c14ec7bd21c6cd5bd995272b3faff6')
Gitlab.commit_status(42, '6104942438c14ec7bd21c6cd5bd995272b3faff6', { name: 'jenkins' })
Gitlab.commit_status(42, '6104942438c14ec7bd21c6cd5bd995272b3faff6', { name: 'jenkins', all: true })

Parameters:

  • project (Integer, String)

    The ID or name of a project.

  • sha (String)

    The commit hash

  • options (Hash) (defaults to: {})

    A customizable set of options.

Options Hash (options):

  • :ref (String)

    Filter by ref name, it can be branch or tag

  • :stage (String)

    Filter by stage

  • :name (String)

    Filter by status name, eg. jenkins

  • :all (Boolean)

    The flag to return all statuses, not only latest ones



149
150
151
# File 'lib/gitlab/client/commits.rb', line 149

def commit_status(project, sha, options = {})
  get("/projects/#{url_encode project}/repository/commits/#{sha}/statuses", query: options)
end