MCPcopy Index your code
hub / github.com/FirefoxCSS-Store/FirefoxCSS-Store.github.io / readGithub

Function readGithub

scripts/repository-stats.mjs:53–63  ·  view source on GitHub ↗
({ owner, name })

Source from the content-addressed store, hash-verified

51}
52
53async function readGithub({ owner, name }) {
54 const headers = githubToken ? { Authorization: `Bearer ${githubToken}` } : {}
55 const data = await requestJson(`https://api.github.com/repos/${owner}/${name}`, headers)
56
57 return {
58 stars: data.stargazers_count ?? 0,
59 updatedAt: data.pushed_at ?? data.updated_at ?? null,
60 ownerAvatar: data.owner?.avatar_url ?? null,
61 accessible: true
62 }
63}
64
65async function readGitlab({ owner, name }) {
66 const headers = gitlabToken ? { Authorization: `Bearer ${gitlabToken}` } : {}

Callers 1

fetchRepositoryStatsFunction · 0.70

Calls 1

requestJsonFunction · 0.85

Tested by

no test coverage detected