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

Function ConvertPullRequestToDraft

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

Source from the content-addressed store, hash-verified

852}
853
854func 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
872func 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))

Callers 1

readyRunFunction · 0.92

Calls 2

MutateMethod · 0.65
RepoHostMethod · 0.65

Tested by

no test coverage detected