GITHUB_TOKEN only needed for console

This commit is contained in:
Brandon Keepers 2016-10-16 09:59:19 -05:00
parent d1055f5056
commit 039d0edf1b
No known key found for this signature in database
GPG Key ID: F9533396D5FACBF6
2 changed files with 11 additions and 5 deletions

View File

@ -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=

View File

@ -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;