diff --git a/README.md b/README.md index 278fb54..c60d7ae 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ You have to create a token with the `read:org` access. The following command allows you to get information on your organization. The generated files may be found in the `data` folder. ``` -yarn start +yarn start generate ``` The following command allows you to get insights from your organization's information. diff --git a/src/core.js b/src/core.js index a5c82ce..7916c65 100644 --- a/src/core.js +++ b/src/core.js @@ -28,7 +28,7 @@ async function* generateOrganizationData(githubOrganization) { const repositories = await getRepositoriesByUser(member.login) for (repository of repositories) { - await sleep(25) + await sleep(1000) const contributors = await getRepositoryContributors( repository.owner.login, repository.name, diff --git a/src/queries.js b/src/queries.js index 87894a3..276ee50 100644 --- a/src/queries.js +++ b/src/queries.js @@ -27,7 +27,8 @@ async function getRateLimit() { async function getRepositoryContributors(owner, repository) { try { const res = await fetch( - `https://api.github.com/repos/${owner}/${repository}/stats/contributors?access_token=${githubToken}`, + `https://api.github.com/repos/${owner}/${repository}/stats/contributors + `, { headers: { 'User-Agent': githubId } }, ) if (!res.ok) { @@ -36,7 +37,7 @@ async function getRepositoryContributors(owner, repository) { if (res.status === 204) { return [] } - return res.json() + return [res.json()] } catch (e) { console.log(e) process.exit(0)