We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 7db01ef + 7d1f69d commit c97af6eCopy full SHA for c97af6e
1 file changed
src/index.js
@@ -10,8 +10,6 @@ import minimatch from 'minimatch';
10
import parse from 'url-parse';
11
import pkg from '../package.json';
12
13
-const octokit = new Octokit();
14
-
15
program
16
.version(pkg.version)
17
.usage('<command> [<args>]')
@@ -38,13 +36,15 @@ program.parse(process.argv);
38
36
39
37
const [command, ...args] = program.args;
40
41
-if (command !== 'list') {
42
- octokit.authenticate({
43
- type: 'oauth',
44
- token: program.token || process.env.GITHUB_TOKEN
45
- });
46
-}
47
+const octokit = new Octokit({
+ auth() {
+ const token = (program.token || process.env.GITHUB_TOKEN);
+ if (token) {
+ return `token ${token}`;
+ }
+});
+
48
function next(response) {
49
if (!response.headers || !response.headers.link) {
50
return false;
0 commit comments