File tree 2 files changed +227
-286
lines changed
2 files changed +227
-286
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,9 @@ const delay = require('delay')
7
7
const data = require ( '../../webpage/src/data.json' )
8
8
9
9
// https://github.com/settings/tokens
10
- const access_token = process . env . GITHUB_TOKEN
10
+ const config = {
11
+ headers : { Authorization : `token ${ process . env . GITHUB_TOKEN } ` }
12
+ }
11
13
12
14
async function getPackagesData ( ) {
13
15
return Promise . all ( data . rows . map ( getPackageData ) )
@@ -48,13 +50,14 @@ const getNpmDownloads = npm =>
48
50
const getIssueCount = ( github , state ) =>
49
51
axios
50
52
. get (
51
- `https://api.github.com/search/issues?access_token=${ access_token } &q=repo:${ github } +type:issue+state:${ state } `
53
+ `https://api.github.com/search/issues?q=repo:${ github } +type:issue+state:${ state } ` ,
54
+ config
52
55
)
53
56
. then ( response => response . data . total_count )
54
57
55
58
const getGithubRepoStats = github =>
56
59
axios
57
- . get ( `https://api.github.com/repos/${ github } ?access_token= ${ access_token } ` )
60
+ . get ( `https://api.github.com/repos/${ github } ` , config )
58
61
. then ( response => response . data )
59
62
60
63
async function getGithubStats ( github ) {
You can’t perform that action at this time.
0 commit comments