-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathindex.js
More file actions
28 lines (22 loc) · 673 Bytes
/
index.js
File metadata and controls
28 lines (22 loc) · 673 Bytes
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
const Labeler = require("./lib/pr-labeler")
/**
* This is the main entrypoint to your Probot app
* @param {import('probot').Application} app
*/
module.exports = app => {
// Your code here
app.log.info('Loaded the PR-labeler')
app.on('pull_request.opened', label)
app.on('pull_request.edited', label)
app.on('pull_request.synchronize', label)
app.on('pull_request_review', label)
app.on('pull_request_review_comment', label)
async function label(context) {
// Create a PullRequestLabeler
const labeler = new Labeler(context, app.log)
// Fetch some PR info
await labeler.init()
// Do the labeling!
await labeler.label()
}
}