Skip to content

Latest commit

 

History

History
46 lines (30 loc) · 1.5 KB

deployments.md

File metadata and controls

46 lines (30 loc) · 1.5 KB

Repo / Deployments API

Back to the "Repos API" | Back to the navigation

Provides information about deployments for a repository. Wraps GitHub Deployments API.

List all deployments.

$deployments = $client->api('deployment')->all('KnpLabs', 'php-github-api');

You can also filter the returned results (see the documentation for more information):

$deployments = $client->api('deployment')->all('KnpLabs', 'php-github-api', array('environment' => 'production'));

List one deployment.

$deployment = $client->api('deployment')->show('KnpLabs', 'php-github-api', $id);

Create a new deployments.

The ref parameter is required.

$data = $client->api('deployment')->create('KnpLabs', 'php-github-api', array('ref' => 'fd6a5f9e5a430dddae8d6a8ea378f913d3a766f9'));

Please note that once a deployment is created it cannot be edited. Only status updates can be created.

Create a new status update.

The state parameter is required. At the time of writing, this must be pending, success, error, or failure.

$data = $client->api('deployment')->updateStatus('KnpLabs', 'php-github-api', 1, array('state' => 'error', 'description' => 'syntax error'));

Get all status updates for a deployment.

$statusUpdates = $client->api('deployment')->getStatuses('KnpLabs', 'php-github-api', 1);