({ owner, name })
| 51 | } |
| 52 | |
| 53 | async 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 | |
| 65 | async function readGitlab({ owner, name }) { |
| 66 | const headers = gitlabToken ? { Authorization: `Bearer ${gitlabToken}` } : {} |
no test coverage detected