diff --git a/lib/github-auth.js b/lib/github-auth.js index 9efd5830861de..401ca252d6bd5 100644 --- a/lib/github-auth.js +++ b/lib/github-auth.js @@ -21,6 +21,11 @@ autosave(githubUserTokensFile, {data:[]}).then(function(f) { if (serverSecrets && serverSecrets.gh_token) { addGithubToken(serverSecrets.gh_token); } + // Travis-CI environment variable `github_token` + // Used only for tests + if (process.env.TRAVIS && process.env.github_token){ + addGithubToken(process.env.github_token); + } }).catch(function(e) { console.error('Could not create ' + githubUserTokensFile); }); function setRoutes(server) {