MCPcopy Create free account
hub / github.com/sourcebot-dev/sourcebot / addGithubRepo

Function addGithubRepo

packages/web/src/features/workerApi/actions.ts:86–107  ·  view source on GitHub ↗
(owner: string, repo: string)

Source from the content-addressed store, hash-verified

84);
85
86export const addGithubRepo = async (owner: string, repo: string) => sew(() =>
87 withOptionalAuth(async () => {
88 const response = await fetch(`${WORKER_API_URL}/api/experimental/add-github-repo`, {
89 method: 'POST',
90 body: JSON.stringify({ owner, repo }),
91 headers: {
92 'Content-Type': 'application/json',
93 },
94 });
95
96 if (!response.ok) {
97 return unexpectedError('Failed to add GitHub repo');
98 }
99
100 const data = await response.json();
101 const schema = z.object({
102 jobId: z.string(),
103 repoId: z.number(),
104 });
105 return schema.parse(data);
106 })
107);

Callers 1

GitHubRepoPageFunction · 0.90

Calls 3

sewFunction · 0.90
withOptionalAuthFunction · 0.90
unexpectedErrorFunction · 0.90

Tested by

no test coverage detected