Method: Gitlab::Client::Commits#commit_status

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

#commit_status(id, 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)

    The ID 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)

    Filer by status name, eg. jenkins

  • :all (Boolean)

    The flag to return all statuses, not only latest ones



97
98
99
# File 'lib/gitlab/client/commits.rb', line 97

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