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.
1 parent da2502a commit 7d1f69dCopy full SHA for 7d1f69d
1 file changed
src/index.js
@@ -36,12 +36,15 @@ program.parse(process.argv);
36
37
const [command, ...args] = program.args;
38
39
-const octoptions = {};
40
-if (command !== 'list') {
41
- octoptions.auth = `token ${program.token || process.env.GITHUB_TOKEN}`
42
-}
43
-const octokit = new Octokit(octoptions);
44
-
+const octokit = new Octokit({
+ auth() {
+ const token = (program.token || process.env.GITHUB_TOKEN);
+ if (token) {
+ return `token ${token}`;
+ }
45
46
+});
47
+
48
function next(response) {
49
if (!response.headers || !response.headers.link) {
50
return false;
0 commit comments