From 4eaf3f37683578971da2fb6bfd79d2b015d26c2a Mon Sep 17 00:00:00 2001 From: Fernando Montoya Date: Tue, 27 Mar 2018 09:58:56 +0200 Subject: [PATCH 1/3] Added GitHub token for authenticated GitHub API calls --- src/scripts/fetch_package_names.js | 5 +++++ yarn.lock | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/scripts/fetch_package_names.js b/src/scripts/fetch_package_names.js index 054f4f36e609..a00a4dad003d 100644 --- a/src/scripts/fetch_package_names.js +++ b/src/scripts/fetch_package_names.js @@ -35,6 +35,11 @@ function main() { function fetchPackageNames(options, cb) { const github = new GitHubApi(); + github.authenticate({ + type: 'token', + token: process.env.GITHUB_TOKEN + }) + // XXX: weak since this handles only one page github.repos.getForOrg({ org: options.organization, diff --git a/yarn.lock b/yarn.lock index 448210642771..2a6ba12e18e6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7439,9 +7439,9 @@ tap-parser@^6.0.1: js-yaml "^3.2.7" minipass "^2.2.0" -"tap-render@github:munter/tap-render#0.1.7-patch1": +tap-render@Munter/tap-render#0.1.7-patch1: version "0.1.7" - resolved "https://codeload.github.com/munter/tap-render/tar.gz/35bf3ac21c4fd2776d8569d5e8a1ab62df1f6d4f" + resolved "https://codeload.github.com/Munter/tap-render/tar.gz/35bf3ac21c4fd2776d8569d5e8a1ab62df1f6d4f" dependencies: jsonify "0.0.0" pause-stream "0.0.7" From 67f448a824a244f6361e8d27f10a9007754e0cab Mon Sep 17 00:00:00 2001 From: Fernando Montoya Date: Tue, 27 Mar 2018 10:29:22 +0200 Subject: [PATCH 2/3] fix(lint) Add semicolon --- src/scripts/fetch_package_names.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scripts/fetch_package_names.js b/src/scripts/fetch_package_names.js index a00a4dad003d..5ba5698d5e15 100644 --- a/src/scripts/fetch_package_names.js +++ b/src/scripts/fetch_package_names.js @@ -38,7 +38,7 @@ function fetchPackageNames(options, cb) { github.authenticate({ type: 'token', token: process.env.GITHUB_TOKEN - }) + }); // XXX: weak since this handles only one page github.repos.getForOrg({ From f9e60850a5617c8d234ba754439067fea2ee2536 Mon Sep 17 00:00:00 2001 From: Fernando Montoya Date: Tue, 27 Mar 2018 11:02:48 +0200 Subject: [PATCH 3/3] chore(fetch) Guard env variable access --- src/scripts/fetch_package_names.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/scripts/fetch_package_names.js b/src/scripts/fetch_package_names.js index 5ba5698d5e15..77a5f07d580e 100644 --- a/src/scripts/fetch_package_names.js +++ b/src/scripts/fetch_package_names.js @@ -35,10 +35,12 @@ function main() { function fetchPackageNames(options, cb) { const github = new GitHubApi(); - github.authenticate({ - type: 'token', - token: process.env.GITHUB_TOKEN - }); + if(process.env.GITHUB_TOKEN) { + github.authenticate({ + type: 'token', + token: process.env.GITHUB_TOKEN + }); + } // XXX: weak since this handles only one page github.repos.getForOrg({