MCPcopy Index your code
hub / github.com/cli/cli / deleteTag

Function deleteTag

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

Source from the content-addressed store, hash-verified

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

Callers 1

deleteRunFunction · 0.85

Calls 7

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

Tested by

no test coverage detected