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