Skip to content

Commit 29c1f70

Browse files
GrahamCampbellm1guelpf
authored andcommitted
Added commit build status endpoints
1 parent fd52300 commit 29c1f70

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

lib/Gitlab/Api/Repositories.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,31 @@ public function createCommitComment($project_id, $sha, $note, array $params = ar
270270
return $this->post($this->getProjectPath($project_id, 'repository/commits/'.$this->encodePath($sha).'/comments'), $params);
271271
}
272272

273+
/**
274+
* @param int $project_id
275+
* @param string $sha
276+
* @param array $params
277+
* @return mixed
278+
*/
279+
public function getCommitBuildStatus($project_id, $sha, array $params = array())
280+
{
281+
return $this->get($this->getProjectPath($project_id, 'repository/commits/'.$this->encodePath($sha).'/statuses'), $params);
282+
}
283+
284+
/**
285+
* @param int $project_id
286+
* @param string $sha
287+
* @param string $state
288+
* @param array $params
289+
* @return mixed
290+
*/
291+
public function postCommitBuildStatus($project_id, $sha, $state, array $params = array())
292+
{
293+
$params['state'] = $state;
294+
295+
return $this->post($this->getProjectPath($project_id, 'statuses/'.$this->encodePath($sha)), $params);
296+
}
297+
273298
/**
274299
* @param int $project_id
275300
* @param string $fromShaOrMaster

0 commit comments

Comments
 (0)