This repository has been archived by the owner on Aug 19, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
68 lines (54 loc) · 2.02 KB
/
app.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/**
* This is the main entrypoint to your Probot app
* @param {import('probot').Probot} app
*/
// import handlers
const issueOpened = require("./handlers/issues-opened");
const issueClosed = require("./handlers/issues-closed");
const issueReopened = require("./handlers/issues-reopened");
const issueLabeled = require("./handlers/issues-labeled");
const pullRequestOpened = require("./handlers/pull-request-opened");
const pullRequestClosed = require("./handlers/pull-request-closed");
const pullRequestReopened = require("./handlers/pull-request-reopened");
const pullRequestUnlabeled = require("./handlers/pull-request-unlabeled");
module.exports = (app) => {
app.log.info("Yay, the app was loaded!!!");
//**************** /////////// Issues /////////// ****************//
// on opening an issue
app.on("issues.opened", async (context) => {
await issueOpened(app, context);
});
// on closing an issue
app.on("issues.closed", async (context) => {
await issueClosed(app, context);
});
// on issue reopened
app.on("issues.reopened", async (context) => {
await issueReopened(app, context);
});
// on issue labeled
app.on("issues.labeled", async (context) => {
await issueLabeled(app, context);
});
//**************** /////////// Pull Requests /////////// ****************//
// on opening a pull request
app.on("pull_request.opened", async (context) => {
await pullRequestOpened(app, context);
});
// on closing a pull request
app.on("pull_request.closed", async (context) => {
await pullRequestClosed(app, context);
});
// on pull request reopened
app.on("pull_request.reopened", async (context) => {
await pullRequestReopened(app, context);
});
// on unlabeled pull request
app.on("pull_request.unlabeled", async (context) => {
await pullRequestUnlabeled(app, context);
});
//// For more information on building apps:
//// https://probot.github.io/docs/
//// To get your app running against GitHub, see:
//// https://probot.github.io/docs/development/
};