From da2502a4fe6033e7869e3f8afe524fa62a381bf0 Mon Sep 17 00:00:00 2001 From: Emiliano Heyns Date: Mon, 28 Jan 2019 15:35:09 +0100 Subject: [PATCH] migrate to new auth API --- src/index.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) 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) {