mirror of
https://github.com/zhigang1992/probot.git
synced 2026-06-16 02:44:19 +08:00
* origin/master:
maximize cat gifage
create new error instead of eslint disable
confirmed my localdev is is 😵
tetsing if a standard error fails on CI
STANDARD LINT ALL OF THE THINGS
update plugin usage
Add support for update-docs and new-issue-welcome
38 lines
1001 B
JavaScript
Executable File
38 lines
1001 B
JavaScript
Executable File
#!/usr/bin/env node
|
|
// Usage: bin/simulate issues path/to/payload app.js
|
|
|
|
require('dotenv').config({silent: true})
|
|
|
|
const path = require('path')
|
|
const program = require('commander')
|
|
const {findPrivateKey} = require('../lib/private-key')
|
|
|
|
program
|
|
.usage('[options] <event-name> <path/to/payload.json> [path/to/app.js...]')
|
|
.option('-a, --app <id>', 'ID of the GitHub App', process.env.APP_ID)
|
|
.option('-P, --private-key <file>', 'Path to certificate of the GitHub App', findPrivateKey)
|
|
.parse(process.argv)
|
|
|
|
const eventName = program.args[0]
|
|
const payloadPath = program.args[1]
|
|
|
|
if (!eventName || !payloadPath) {
|
|
program.help()
|
|
}
|
|
|
|
const payload = require(path.join(process.cwd(), payloadPath))
|
|
|
|
const createProbot = require('../')
|
|
|
|
const probot = createProbot({
|
|
id: program.app,
|
|
cert: findPrivateKey()
|
|
})
|
|
|
|
const plugins = require('../lib/plugin')(probot)
|
|
|
|
plugins.load(program.args.slice(2))
|
|
|
|
probot.logger.debug('Simulating event', eventName)
|
|
probot.receive({event: eventName, payload})
|