forked from mirrors/probot
GITHUB_TOKEN only needed for console
This commit is contained in:
parent
d1055f5056
commit
039d0edf1b
|
@ -2,7 +2,3 @@
|
|||
INTEGRATION_ID=
|
||||
|
||||
WEBHOOK_SECRET=development
|
||||
|
||||
# Visit https://github.com/settings/tokens/new to create a new personal access
|
||||
# token with `repo` scope.
|
||||
GITHUB_TOKEN=
|
||||
|
|
|
@ -1,7 +1,17 @@
|
|||
#!/usr/bin/env node
|
||||
// Console for experimenting with GitHub API requests.
|
||||
//
|
||||
// Usage: GITHUB_TOKEN=xxx script/Console
|
||||
//
|
||||
|
||||
require('dotenv').config();
|
||||
|
||||
if (!process.env.GITHUB_TOKEN) {
|
||||
console.error('GITHUB_TOKEN environment variable must be set.');
|
||||
console.error('Create a personal access token at https://github.com/settings/tokens/new');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const repl = require('repl').start('> ');
|
||||
const GitHubApi = require('github');
|
||||
const github = new GitHubApi();
|
||||
|
@ -9,6 +19,6 @@ const github = new GitHubApi();
|
|||
github.authenticate({
|
||||
type: 'oauth',
|
||||
token: process.env.GITHUB_TOKEN
|
||||
});
|
||||
})
|
||||
|
||||
repl.context.github = github;
|
||||
|
|
Loading…
Reference in New Issue