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 #1815 from xuxiaowei-com-cn/xuxiaowei/DeleteProjec…
Browse files Browse the repository at this point in the history
…tArtifacts

✨ delete artifacts eligible for deletion in a project
  • Loading branch information
svanharmelen authored Oct 4, 2023
2 parents 8cb9c32 + 6aff7b6 commit 9085e18
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 9085e18

Please sign in to comment.