forked from wip/app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
38 lines (34 loc) · 983 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
37
38
module.exports = wip;
const handlePullRequestChange = require("./lib/handle-pull-request-change");
const handleMarketplacePurchase = require("./lib/handle-marketplace-purchase");
const handleInstallation = require("./lib/handle-installation");
/**
* @param {import('probot').Probot} app
*/
function wip(app) {
// listen to all relevant pull request event actions
app.on(
[
"pull_request.opened",
"pull_request.edited",
"pull_request.labeled",
"pull_request.unlabeled",
"pull_request.synchronize",
],
handlePullRequestChange.bind(null, app)
);
// listen to relevant marketplace purchase events
app.on(
[
"marketplace_purchase.purchased",
"marketplace_purchase.changed",
"marketplace_purchase.cancelled",
],
handleMarketplacePurchase.bind(null, app)
);
// listen to installation events
app.on(
["installation", "installation_repositories"],
handleInstallation.bind(null, app)
);
}