Install github api
This commit is contained in:
parent
43bb637c39
commit
7308ef334e
124 changed files with 2425 additions and 2525 deletions
|
@ -11,8 +11,6 @@ use Github\Exception\MissingArgumentException;
|
|||
*/
|
||||
class Deployment extends AbstractApi
|
||||
{
|
||||
use AcceptHeaderTrait;
|
||||
|
||||
/**
|
||||
* List deployments for a particular repository.
|
||||
*
|
||||
|
@ -68,21 +66,6 @@ class Deployment extends AbstractApi
|
|||
return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/deployments', $params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a deployment for the given username and repo.
|
||||
*
|
||||
* @link https://docs.github.com/en/rest/reference/repos#delete-a-deployment
|
||||
*
|
||||
* Important: Deployments can only be deleted when in inactive state
|
||||
* @see updateStatus
|
||||
*
|
||||
* @return mixed null on success, array on error with 'message'
|
||||
*/
|
||||
public function remove(string $username, string $repository, int $id)
|
||||
{
|
||||
return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/deployments/'.$id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a deployment by creating a new status update.
|
||||
*
|
||||
|
@ -93,7 +76,7 @@ class Deployment extends AbstractApi
|
|||
* @param int $id the deployment number
|
||||
* @param array $params The information about the deployment update.
|
||||
* Must include a "state" field of pending, success, error, or failure.
|
||||
* May also be given a target_url and description, see link for more details.
|
||||
* May also be given a target_url and description, ßee link for more details.
|
||||
*
|
||||
* @throws MissingArgumentException
|
||||
*
|
||||
|
@ -105,15 +88,6 @@ class Deployment extends AbstractApi
|
|||
throw new MissingArgumentException(['state']);
|
||||
}
|
||||
|
||||
// adjust media-type per github docs
|
||||
// https://docs.github.com/en/rest/reference/repos#create-a-deployment-status
|
||||
if ($params['state'] === 'inactive') {
|
||||
$this->acceptHeaderValue = 'application/vnd.github.ant-man-preview+json';
|
||||
}
|
||||
if ($params['state'] === 'in_progress' || $params['state'] === 'queued') {
|
||||
$this->acceptHeaderValue = 'application/vnd.github.flash-preview+json';
|
||||
}
|
||||
|
||||
return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/deployments/'.$id.'/statuses', $params);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue