Skip to content

Commit

Permalink
migrate to new auth API
Browse files Browse the repository at this point in the history
  • Loading branch information
retorquere committed Jan 28, 2019
1 parent 7db01ef commit da2502a
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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('<command> [<args>]')
Expand All @@ -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) {
Expand Down

0 comments on commit da2502a

Please sign in to comment.