MCPcopy Create free account
hub / github.com/cli/cli / deleteTag

Function deleteTag

pkg/cmd/release/delete/delete.go:143–163  ·  view source on GitHub ↗
(httpClient *http.Client, baseRepo ghrepo.Interface, tagName string)

Source from the content-addressed store, hash-verified

141}
142
143func deleteTag(httpClient *http.Client, baseRepo ghrepo.Interface, tagName string) error {
144 url, err := safeurl.JoinPathWithHostPrefix(ghinstance.RESTPrefix(baseRepo.RepoHost()), "repos", baseRepo.RepoOwner(), baseRepo.RepoName(), "git", "refs", fmt.Sprintf("tags/%s", tagName))
145 if err != nil {
146 return err
147 }
148 req, err := http.NewRequest("DELETE", url.String(), nil)
149 if err != nil {
150 return err
151 }
152
153 resp, err := httpClient.Do(req)
154 if err != nil {
155 return err
156 }
157 defer resp.Body.Close()
158
159 if resp.StatusCode > 299 {
160 return api.HandleHTTPError(resp)
161 }
162 return nil
163}

Callers 1

deleteRunFunction · 0.85

Calls 9

JoinPathWithHostPrefixFunction · 0.92
RESTPrefixFunction · 0.92
HandleHTTPErrorFunction · 0.92
RepoHostMethod · 0.65
RepoOwnerMethod · 0.65
RepoNameMethod · 0.65
StringMethod · 0.65
DoMethod · 0.65
CloseMethod · 0.65

Tested by

no test coverage detected