MCPcopy Create free account
hub / github.com/lightdash/lightdash / createPullRequest

Function createPullRequest

packages/backend/src/clients/github/Github.ts:961–997  ·  view source on GitHub ↗
({
    owner,
    repo,
    title,
    body,
    head,
    base,
    installationId,
    token,
}: {
    owner: string;
    repo: string;
    title: string;
    body: string;
    head: string;
    base: string;
    installationId?: string;
    token?: string;
})

Source from the content-addressed store, hash-verified

959};
960
961export 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
999export const updatePullRequest = async ({
1000 owner,

Callers 6

writebackEntryMethod · 0.90
openPullRequestMethod · 0.90
createPullRequestMethod · 0.50

Calls 3

getOctokitFunction · 0.85
toGitWriteErrorFunction · 0.85
createMethod · 0.65

Tested by

no test coverage detected