Back to the "Repos API" | Back to the navigation
Provides information about deployments for a repository. Wraps GitHub Deployments API.
$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'));$deployment = $client->api('deployment')->show('KnpLabs', 'php-github-api', $id);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.
$deployment = $client->api('deployment')->show('KnpLabs', 'php-github-api', $id);Please note that a deployment can only be deleted when in inactive state.
Consider transitioning the status to inactive beforehand using updateStatus.
The state parameter is required. At the time of writing, this must be pending, queued, in_progress, success, inactive, error, or failure.
$data = $client->api('deployment')->updateStatus('KnpLabs', 'php-github-api', 1, array('state' => 'error', 'description' => 'syntax error'));$statusUpdates = $client->api('deployment')->getStatuses('KnpLabs', 'php-github-api', 1);