(title: string, head: string)
| 602 | } |
| 603 | |
| 604 | async createPR(title: string, head: string) { |
| 605 | const [repository, headReference] = await Promise.all([ |
| 606 | this.getRepository(this.originRepoOwner, this.originRepoName), |
| 607 | this.useOpenAuthoring ? `${(await this.user()).login}:${head}` : head, |
| 608 | ]); |
| 609 | const { data } = await this.mutate({ |
| 610 | mutation: mutations.createPullRequest, |
| 611 | variables: { |
| 612 | createPullRequestInput: { |
| 613 | baseRefName: this.branch, |
| 614 | body: DEFAULT_PR_BODY, |
| 615 | title, |
| 616 | headRefName: headReference, |
| 617 | repositoryId: repository.id, |
| 618 | }, |
| 619 | }, |
| 620 | update: (store, { data: mutationResult }) => { |
| 621 | const { pullRequest } = mutationResult!.createPullRequest; |
| 622 | const pullRequestData = { repository: { ...pullRequest.repository, pullRequest } }; |
| 623 | |
| 624 | store.writeQuery({ |
| 625 | ...this.getPullRequestQuery(pullRequest.number), |
| 626 | data: pullRequestData, |
| 627 | }); |
| 628 | }, |
| 629 | }); |
| 630 | const { pullRequest } = data!.createPullRequest; |
| 631 | return { ...pullRequest, head: { sha: pullRequest.headRefOid } }; |
| 632 | } |
| 633 | |
| 634 | async createBranch(branchName: string, sha: string) { |
| 635 | const owner = this.repoOwner; |
nothing calls this directly
no test coverage detected