Skip to content

Commit 095f463

Browse files
committed
Deployments: added missing 'delete deployment' endpoint
per https://docs.github.com/en/rest/reference/repos#delete-a-deployment
1 parent 90e695e commit 095f463

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

lib/Github/Api/Deployment.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,23 @@ public function create($username, $repository, array $params)
6666
return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/deployments', $params);
6767
}
6868

69+
/**
70+
* Delete a deployment for the given username and repo.
71+
*
72+
* @link https://docs.github.com/en/rest/reference/repos#delete-a-deployment
73+
*
74+
* Important: Deployments can only be deleted when in inactive state
75+
* @see updateStatus
76+
*
77+
* @param string $username the user who owns the repo
78+
* @param string $repository the name of the repo
79+
* @param int $id the id of the deployment
80+
*/
81+
public function remove($username, $repository, $id)
82+
{
83+
return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/deployments/'.$id);
84+
}
85+
6986
/**
7087
* Updates a deployment by creating a new status update.
7188
*

0 commit comments

Comments
 (0)