commit_statuses

Create or update a commit pipeline status

Creates or updates the status of a commit represented by a job in an external stage. If the commit is associated with a merge request, target the commit in the merge request source branch.

post/api/v4/projects/{id}/statuses/{sha}

Request

  • Base URL
    https://gitlab.com
  • Auth
    none declared

Path parameters

idstring required

ID or URL-encoded path of the project.

shastring required

The commit hash

Request body

state'pending' | 'running' | 'success' | 'failed' | 'canceled' | 'skipped' required

The state of the status

refstring

The ref

target_urlstring

The target URL to associate with this status

descriptionstring

A short description of the status

namestring

A string label to differentiate this status from the status of other systems

contextstring

A string label to differentiate this status from the status of other systems

coveragenumber float

The total code coverage

pipeline_idinteger

An existing pipeline ID, when multiple pipelines on the same commit SHA have been triggered

Example request

{
  "state": "pending",
  "ref": "develop",
  "target_url": "https://gitlab.example.com/janedoe/gitlab-foss/builds/91",
  "name": "coverage",
  "context": "coverage",
  "coverage": 100
}

Response

Create or update a commit pipeline status

idinteger required
shastring required
refstring required
statusstring required
namestring required
target_urlstring required
descriptionstring required
created_atstring date-time required
started_atstring date-time required
finished_atstring date-time required
allow_failureboolean required
coveragenumber float required
pipeline_idinteger required

Example response

{
  "id": 93,
  "sha": "18f3e63d05582537db6d183d9d557be09e1f90c8",
  "ref": "develop",
  "status": "success",
  "name": "default",
  "target_url": "https://gitlab.example.com/janedoe/gitlab-foss/builds/91",
  "created_at": "2016-01-19T09:05:50.355Z",
  "started_at": "2016-01-20T08:40:25.832Z",
  "finished_at": "2016-01-21T08:40:25.832Z",
  "coverage": 98.29,
  "pipeline_id": 101,
  "author": {
    "id": 1,
    "username": "admin",
    "public_email": "john@example.com",
    "name": "Administrator",
    "state": "active",
    "avatar_url": "https://gravatar.com/avatar/1",
    "avatar_path": "/user/avatar/28/The-Big-Lebowski-400-400.png",
    "custom_attributes": [
      {
        "key": "foo",
        "value": "bar"
      }
    ],
    "web_url": "https://gitlab.example.com/root"
  }
}

Changes

No recorded changes to this operation across all 5 revisions of this API.