({
owner,
repo,
title,
body,
head,
base,
installationId,
token,
}: {
owner: string;
repo: string;
title: string;
body: string;
head: string;
base: string;
installationId?: string;
token?: string;
})
| 959 | }; |
| 960 | |
| 961 | export const createPullRequest = async ({ |
| 962 | owner, |
| 963 | repo, |
| 964 | title, |
| 965 | body, |
| 966 | head, |
| 967 | base, |
| 968 | installationId, |
| 969 | token, |
| 970 | }: { |
| 971 | owner: string; |
| 972 | repo: string; |
| 973 | title: string; |
| 974 | body: string; |
| 975 | head: string; |
| 976 | base: string; |
| 977 | installationId?: string; |
| 978 | token?: string; |
| 979 | }) => { |
| 980 | const { octokit, headers } = getOctokit(installationId, token); |
| 981 | |
| 982 | try { |
| 983 | const response = await octokit.rest.pulls.create({ |
| 984 | owner, |
| 985 | repo, |
| 986 | title, |
| 987 | body, |
| 988 | head, |
| 989 | base, |
| 990 | headers, |
| 991 | }); |
| 992 | |
| 993 | return response.data; |
| 994 | } catch (e) { |
| 995 | throw toGitWriteError(e); |
| 996 | } |
| 997 | }; |
| 998 | |
| 999 | export const updatePullRequest = async ({ |
| 1000 | owner, |
no test coverage detected