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

Function ConvertPullRequestToDraft

api/queries_pr.go:829–845  ·  view source on GitHub ↗
(client *Client, repo ghrepo.Interface, pr *PullRequest)

Source from the content-addressed store, hash-verified

827}
828
829func ConvertPullRequestToDraft(client *Client, repo ghrepo.Interface, pr *PullRequest) error {
830 var mutation struct {
831 ConvertPullRequestToDraft struct {
832 PullRequest struct {
833 ID githubv4.ID
834 }
835 } `graphql:"convertPullRequestToDraft(input: $input)"`
836 }
837
838 variables := map[string]interface{}{
839 "input": githubv4.ConvertPullRequestToDraftInput{
840 PullRequestID: pr.ID,
841 },
842 }
843
844 return client.Mutate(repo.RepoHost(), "ConvertPullRequestToDraft", &mutation, variables)
845}
846
847func BranchDeleteRemote(client *Client, repo ghrepo.Interface, branch string) error {
848 path := fmt.Sprintf("repos/%s/%s/git/refs/heads/%s", repo.RepoOwner(), repo.RepoName(), url.PathEscape(branch))

Callers 1

readyRunFunction · 0.92

Calls 2

MutateMethod · 0.65
RepoHostMethod · 0.65

Tested by

no test coverage detected