MCPcopy
hub / github.com/Dokploy/dokploy / authGithub

Function authGithub

packages/server/src/utils/providers/github.ts:11–29  ·  view source on GitHub ↗
(githubProvider: Github)

Source from the content-addressed store, hash-verified

9import type { z } from "zod";
10
11export const authGithub = (githubProvider: Github): Octokit => {
12 if (!haveGithubRequirements(githubProvider)) {
13 throw new TRPCError({
14 code: "NOT_FOUND",
15 message: "Github Account not configured correctly",
16 });
17 }
18
19 const octokit: Octokit = new Octokit({
20 authStrategy: createAppAuth,
21 auth: {
22 appId: githubProvider?.githubAppId || 0,
23 privateKey: githubProvider?.githubPrivateKey || "",
24 installationId: githubProvider?.githubInstallationId,
25 },
26 });
27
28 return octokit;
29};
30
31export const getGithubToken = async (
32 octokit: ReturnType<typeof authGithub>,

Callers 8

issueCommentExistsFunction · 0.90
updateIssueCommentFunction · 0.90
createPreviewDeploymentFunction · 0.90
cloneGithubRepositoryFunction · 0.85

Calls 1

haveGithubRequirementsFunction · 0.85

Tested by

no test coverage detected