DeleteRef deletes a ref from a repository. GitHub API docs: https://docs.github.com/rest/git/refs?apiVersion=2022-11-28#delete-a-reference meta:operation DELETE /repos/{owner}/{repo}/git/refs/{ref}
(ctx context.Context, owner, repo, ref string)
| 176 | // |
| 177 | //meta:operation DELETE /repos/{owner}/{repo}/git/refs/{ref} |
| 178 | func (s *GitService) DeleteRef(ctx context.Context, owner, repo, ref string) (*Response, error) { |
| 179 | ref = strings.TrimPrefix(ref, "refs/") |
| 180 | u := fmt.Sprintf("repos/%v/%v/git/refs/%v", owner, repo, refURLEscape(ref)) |
| 181 | req, err := s.client.NewRequest(ctx, "DELETE", u, nil) |
| 182 | if err != nil { |
| 183 | return nil, err |
| 184 | } |
| 185 | |
| 186 | return s.client.Do(req, nil) |
| 187 | } |