| 852 | } |
| 853 | |
| 854 | func ConvertPullRequestToDraft(client *Client, repo ghrepo.Interface, pr *PullRequest) error { |
| 855 | var mutation struct { |
| 856 | ConvertPullRequestToDraft struct { |
| 857 | PullRequest struct { |
| 858 | ID githubv4.ID |
| 859 | } |
| 860 | } `graphql:"convertPullRequestToDraft(input: $input)"` |
| 861 | } |
| 862 | |
| 863 | variables := map[string]any{ |
| 864 | "input": githubv4.ConvertPullRequestToDraftInput{ |
| 865 | PullRequestID: pr.ID, |
| 866 | }, |
| 867 | } |
| 868 | |
| 869 | return client.Mutate(repo.RepoHost(), "ConvertPullRequestToDraft", &mutation, variables) |
| 870 | } |
| 871 | |
| 872 | func BranchDeleteRemote(client *Client, repo ghrepo.Interface, branch string) error { |
| 873 | path, err := safeurl.JoinPath("repos", repo.RepoOwner(), repo.RepoName(), "git", "refs", fmt.Sprintf("heads/%s", branch)) |