126
127
async createPullRequest(
129
>
repo: string,
130
>
title: string,
131
>
body: string,
132
>
head: string,
133
>
base: string,
134
>
draft: boolean,
135
>
token: string,
136
>
signal: AbortSignal,
137
>
): Promise<CreatedPullRequest> {
138
>
const response = await this._makeGHAPIRequest<GitHubPullRequestResponseItem>(
139
>
`repos/${owner}/${repo}/pulls`,
140
>
'POST',
141
>
token,
142
>
signal,
143
>
{ title, body, head, base, draft },
144
>
);
145
146
const number = response.data?.number;
148
>
if (typeof html_url !== 'string' || typeof number !== 'number') {
149
throw new Error(`Failed to create pull request for ${owner}/${repo}`);
150
}
151
152
const node_id = response.data?.node_id;
154
>
}
155
156
async findPullRequestByHeadBranch(owner: string, repo: string, branch: string, token: string, signal: AbortSignal): Promise<CreatedPullRequest | undefined> {