[READ-ONLY] Mirror of https://github.com/flo-bit/edge-function-github-contribution. edge-function-github-contribution.vercel.app
0

Configure Feed

Select the types of activity you want to include in your feed.

add anons

+4 -3
+4 -3
api/github-contributors.ts
··· 22 22 23 23 while (true) { 24 24 const response = await fetch( 25 - `https://api.github.com/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/contributors?per_page=100&page=${page}`, 25 + `https://api.github.com/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/contributors?per_page=100&anon=1&page=${page}`, 26 26 { 27 27 headers: { 28 28 'Accept': 'application/vnd.github+json', ··· 44 44 } 45 45 46 46 const data = allContributors.map((c: any) => ({ 47 - username: c.login, 48 - avatarUrl: c.avatar_url, 47 + username: c.login || c.name || 'anonymous', 48 + avatarUrl: c.avatar_url || null, 49 49 contributions: c.contributions, 50 + anonymous: c.type === 'Anonymous', 50 51 })); 51 52 52 53 return cors(req, new Response(JSON.stringify(data), {