forked from nodejs/github-bot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnode-subsystem-label.js
More file actions
31 lines (25 loc) · 828 Bytes
/
node-subsystem-label.js
File metadata and controls
31 lines (25 loc) · 828 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
29
30
31
'use strict'
const debug = require('debug')('node_subsystem_label')
const nodeRepo = require('../lib/node-repo')
module.exports = function (app) {
app.on('pull_request.opened', handlePrCreated)
function handlePrCreated (event, owner, repo) {
const prId = event.number
const logger = event.logger
const baseBranch = event.pull_request.base.ref
// subsystem labelling is for node core only
if (repo !== 'node') return
debug(`/${owner}/${repo}/pull/${prId} opened`)
// by not hard coding the owner repo to nodejs/node here,
// we can test these this script in a different repo than
// *actual* node core as long as the repo is named "node"
nodeRepo.resolveLabelsThenUpdatePr({
owner,
repo,
prId,
logger,
baseBranch,
timeoutInSec: 2
})
}
}