diff --git a/src/index.js b/src/index.js index 00214a0..c2c1862 100755 --- a/src/index.js +++ b/src/index.js @@ -10,8 +10,6 @@ import minimatch from 'minimatch'; import parse from 'url-parse'; import pkg from '../package.json'; -const octokit = new Octokit(); - program .version(pkg.version) .usage(' []') @@ -38,12 +36,11 @@ program.parse(process.argv); const [command, ...args] = program.args; +const octoptions = {}; if (command !== 'list') { - octokit.authenticate({ - type: 'oauth', - token: program.token || process.env.GITHUB_TOKEN - }); + octoptions.auth = `token ${program.token || process.env.GITHUB_TOKEN}` } +const octokit = new Octokit(octoptions); function next(response) { if (!response.headers || !response.headers.link) {