-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
36 lines (29 loc) · 949 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
const commands = require('probot-commands')
const onboard = require('./lib/onboard')
const check = require('./lib/check')
const bootstrap = require('./lib/bootstrap')
const revert = require('./lib/revert')
const { provideHelp } = require('./lib/utils/conversation')
module.exports = (robot) => {
const app = robot.route('/')
app.use(require('express').static('public'))
robot.on(['installation.created', 'installation_repositories.added'], context => {
onboard(context)
})
commands(robot, 'check', async(context, command) => {
if (context.isBot) return
check(context)
})
commands(robot, 'bootstrap', async(context, command) => {
if (context.isBot) return
bootstrap(context)
})
commands(robot, 'revert', async(context, command) => {
if (context.isBot) return
revert(context)
})
commands(robot, 'help', async(context, command) => {
if (context.isBot) return
provideHelp(context)
})
}