Skip to content

Commit c97af6e

Browse files
committed
Merge branch 'retorquere-master'
2 parents 7db01ef + 7d1f69d commit c97af6e

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

src/index.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ import minimatch from 'minimatch';
1010
import parse from 'url-parse';
1111
import pkg from '../package.json';
1212

13-
const octokit = new Octokit();
14-
1513
program
1614
.version(pkg.version)
1715
.usage('<command> [<args>]')
@@ -38,13 +36,15 @@ program.parse(process.argv);
3836

3937
const [command, ...args] = program.args;
4038

41-
if (command !== 'list') {
42-
octokit.authenticate({
43-
type: 'oauth',
44-
token: program.token || process.env.GITHUB_TOKEN
45-
});
46-
}
47-
39+
const octokit = new Octokit({
40+
auth() {
41+
const token = (program.token || process.env.GITHUB_TOKEN);
42+
if (token) {
43+
return `token ${token}`;
44+
}
45+
}
46+
});
47+
4848
function next(response) {
4949
if (!response.headers || !response.headers.link) {
5050
return false;

0 commit comments

Comments
 (0)