I'm using the NodeJS OctoKit API and for our business analytics I'm trying to gather a list of all commits across all repositories. So I can make a little "ranking".
const owner = req.params.owner;
const { data } = await octokit.request('GET /user/repos', { type: 'private' })
let total = 0;
data.forEach(element => {
const name = element.name;
octokit.repos.listCommits({
owner,
name,
}).then(r => {
total += r.data.length;
}).catch(error => console.log(error));
})
console.log(total);
I tried something like this but it catches load of 404 errors because I think the repos are private
I guess you solved it by now. How did you initialized octokit? did you put the correct token ?