Commit a488a6e
src/main.ts
@@ -57,7 +57,7 @@ void (async function main() {
retry: { doNotRetry: ['429'] },
})
- if (owner && repo) gitClone(owner, repo)
+ if (owner && repo) gitClone(owner, repo, token)
const data = await getData(octokit, dataPath, username)
let userBadges = getUserBadges()
src/repo.ts
@@ -3,10 +3,15 @@ import { spawnSync } from 'node:child_process'
import { chdir } from 'node:process'
import { Badge } from './badges.js'
-export function gitClone(owner: string, repo: string) {
+export function gitClone(owner: string, repo: string, token: string) {
spawnSync(
'git',
- ['clone', '--depth=1', `https://github.com/${owner}/${repo}.git`, 'repo'],
+ [
+ 'clone',
+ '--depth=1',
+ `https://${owner}:${token}@github.com/${owner}/${repo}.git`,
+ 'repo',
+ ],
{
stdio: 'inherit',
},