Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <organization_name>
yarn start generate
```

The following command allows you to get insights from your organization's information.
Expand Down
2 changes: 1 addition & 1 deletion src/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
5 changes: 3 additions & 2 deletions src/queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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)
Expand Down