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 8763706 commit ef2810eCopy full SHA for ef2810e
1 file changed
src/index.js
@@ -13,6 +13,7 @@ import pkg from '../package.json';
13
program
14
.version(pkg.version)
15
.usage('<command> [<args>]')
16
+ .option('--baseurl <baseurl>', 'API endpoint', 'https://api.github.com')
17
.option('-T, --token <token>', 'OAuth2 token')
18
.option('-o, --owner <owner>', 'owner')
19
.option('-r, --repo <repo>', 'repo')
@@ -36,13 +37,10 @@ program.parse(process.argv);
36
37
38
const [command, ...args] = program.args;
39
40
+const token = (program.token || process.env.GITHUB_TOKEN);
41
const octokit = new Octokit({
- auth() {
- const token = (program.token || process.env.GITHUB_TOKEN);
42
- if (token) {
43
- return `token ${token}`;
44
- }
45
+ auth: token || null,
+ baseUrl: program.baseurl,
46
});
47
48
function next(response) {
0 commit comments