@@ -35,10 +35,7 @@ function buildParametersForRepo (options, repo) {
35
35
} else {
36
36
return [
37
37
{ name : 'CERTIFY_SAFE' , value : 'true' } ,
38
- { name : 'GITHUB_ORG' , value : 'nodejs' } ,
39
- { name : 'REPO_NAME' , value : 'node' } ,
40
- { name : 'PR_ID' , value : options . number } ,
41
- { name : 'REBASE_ONTO' , value : '' }
38
+ { name : 'PR_ID' , value : options . number }
42
39
]
43
40
}
44
41
}
@@ -73,8 +70,7 @@ function triggerBuild (options, cb) {
73
70
return cb ( new Error ( `Expected 200 from Jenkins, got ${ response . statusCode } ` ) )
74
71
}
75
72
76
- cb ( null ,
77
- `https://ci.nodejs.org/blue/organizations/jenkins/${ jobName } /detail/${ jobName } /${ response . body . id } /pipeline` )
73
+ cb ( null , { jobName, jobId : response . body . id } )
78
74
} )
79
75
}
80
76
@@ -86,14 +82,16 @@ function triggerBuildIfValid (options) {
86
82
return logger . debug ( `Ignoring comment to me by @${ options . author } because they are not a repo collaborator` )
87
83
}
88
84
89
- triggerBuild ( options , function onBuildTriggered ( err , buildUrl ) {
85
+ triggerBuild ( options , function onBuildTriggered ( err , { jobName, jobId } ) {
86
+ const jobUrl = `https://ci.nodejs.org/job/${ jobName } /${ jobId } `
87
+ let body = `Lite-CI: ${ jobUrl } `
90
88
if ( err ) {
91
89
logger . error ( err , 'Error while triggering Jenkins build' )
92
- return createPrComment ( options , `@${ options . author } Sadly, an error occurred when I tried to trigger a build. :(` )
90
+ body = 'Sadly, an error occurred when I tried to trigger a build. :('
91
+ } else {
92
+ logger . info ( { jobUrl } , 'Jenkins build started' )
93
93
}
94
-
95
- createPrComment ( options , `@${ options . author } build started: ${ buildUrl } ` )
96
- logger . info ( { buildUrl } , 'Jenkins build started' )
94
+ createPrComment ( options , body )
97
95
} )
98
96
} )
99
97
}
@@ -121,6 +119,7 @@ function handleCommentCreated (event, owner, repo) {
121
119
}
122
120
123
121
function handlePullCreated ( event , owner , repo ) {
122
+ // eslint-disable-next-line camelcase
124
123
const { number, logger, pull_request } = event
125
124
const pullRequestAuthor = pull_request . user . login
126
125
const options = {
0 commit comments