Skip to content

Commit

Permalink
Implement delete method for project deployments
Browse files Browse the repository at this point in the history
  • Loading branch information
Timo Furrer committed Jul 25, 2023
1 parent 60e264a commit 8db1294
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions deployments.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,3 +201,21 @@ func (s *DeploymentsService) UpdateProjectDeployment(pid interface{}, deployment

return d, resp, nil
}

// DeleteProjectDeployment delete a project deployment.
//
// GitLab API docs: https://docs.gitlab.com/ee/api/deployments.html#delete-a-specific-deployment
func (s *DeploymentsService) DeleteProjectDeployment(pid interface{}, deployment int, options ...RequestOptionFunc) (*Response, error) {
project, err := parseID(pid)
if err != nil {
return nil, err
}
u := fmt.Sprintf("projects/%s/deployments/%d", PathEscape(project), deployment)

req, err := s.client.NewRequest(http.MethodDelete, u, nil, options)
if err != nil {
return nil, err
}

return s.client.Do(req, nil)
}

0 comments on commit 8db1294

Please sign in to comment.