MCPcopy Create free account
hub / github.com/SIMARSINGHRAYAT/Gitzo / fetchAllRepos

Function fetchAllRepos

src/utils/github.ts:51–67  ·  view source on GitHub ↗
(token: string)

Source from the content-addressed store, hash-verified

49}
50
51export async function fetchAllRepos(token: string): Promise<GitHubRepo[]> {
52 const allRepos: GitHubRepo[] = [];
53 let page = 1;
54 while (page <= 10) {
55 const res = await ghFetch(
56 `/user/repos?per_page=100&page=${page}&sort=updated&affiliation=owner,collaborator,organization_member`,
57 token
58 );
59 if (!res.ok) break;
60 const data = await res.json();
61 if (!Array.isArray(data) || data.length === 0) break;
62 allRepos.push(...data);
63 if (data.length < 100) break;
64 page++;
65 }
66 return allRepos;
67}
68
69export async function testRepoPermission(
70 token: string,

Callers 1

AppFunction · 0.90

Calls 1

ghFetchFunction · 0.85

Tested by

no test coverage detected