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

Commit

Permalink
✨ delete artifacts eligible for deletion in a project
Browse files Browse the repository at this point in the history
  • Loading branch information
xuxiaowei-com-cn committed Oct 4, 2023
1 parent 8cb9c32 commit 6aff7b6
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions jobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -564,3 +564,22 @@ func (s *JobsService) DeleteArtifacts(pid interface{}, jobID int, options ...Req

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

// DeleteProjectArtifacts delete artifacts eligible for deletion in a project
//
// GitLab API docs:
// https://docs.gitlab.com/ee/api/job_artifacts.html#delete-project-artifacts
func (s *JobsService) DeleteProjectArtifacts(pid interface{}, options ...RequestOptionFunc) (*Response, error) {
project, err := parseID(pid)
if err != nil {
return nil, err
}
u := fmt.Sprintf("projects/%s/artifacts", PathEscape(project))

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 6aff7b6

Please sign in to comment.