Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1762 from timofurrer/deployments
Browse files Browse the repository at this point in the history
Implement delete method for project deployments
  • Loading branch information
svanharmelen authored Jul 30, 2023
2 parents ca917e1 + 8db1294 commit c1c9341
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 c1c9341

Please sign in to comment.