@@ -247,7 +247,7 @@ export class GithubApp extends Probot {
247
247
}
248
248
249
249
const newBody = body + `\n\n${ button } \n\n` ;
250
- const updatePrPromise : Promise < void > = ( ctx . github as any ) . pullRequests . update ( { ...ctx . repo ( ) , number : pr . number , body : newBody } ) ;
250
+ const updatePrPromise = ctx . octokit . pulls . update ( { ...ctx . repo ( ) , pull_number : pr . number , body : newBody } ) ;
251
251
updatePrPromise . catch ( err => log . error ( err , "Error while updating PR body" , { contextURL } ) ) ;
252
252
}
253
253
@@ -265,21 +265,21 @@ export class GithubApp extends Probot {
265
265
266
266
if ( ctx . payload . action === 'synchronize' ) {
267
267
// someone just pushed a commit, remove the label
268
- const delLabelPromise : Promise < void > = ( ctx . github as any ) . issues . removeLabel ( { ...ctx . repo ( ) , number : pr . number , name : label } ) ;
268
+ const delLabelPromise = ctx . octokit . issues . removeLabel ( { ...ctx . repo ( ) , number : pr . number , name : label } ) ;
269
269
delLabelPromise . catch ( err => log . error ( err , "Error while removing label from PR" ) ) ;
270
270
}
271
271
272
272
if ( prebuildStartPromise ) {
273
273
prebuildStartPromise . then ( startWsResult => {
274
274
if ( startWsResult . done ) {
275
275
if ( ! ! startWsResult . didFinish ) {
276
- const addLabelPromise : Promise < void > = ( ctx . github as any ) . issues . addLabels ( { ...ctx . repo ( ) , number : pr . number , labels : [ label ] } ) ;
276
+ const addLabelPromise = ctx . octokit . issues . addLabels ( { ...ctx . repo ( ) , number : pr . number , labels : [ label ] } ) ;
277
277
addLabelPromise . catch ( err => log . error ( err , "Error while adding label to PR" ) ) ;
278
278
}
279
279
} else {
280
280
new PrebuildListener ( this . messageBus , startWsResult . wsid , evt => {
281
281
if ( ! HeadlessWorkspaceEventType . isRunning ( evt ) && HeadlessWorkspaceEventType . didFinish ( evt ) ) {
282
- const addLabelPromise : Promise < void > = ( ctx . github as any ) . issues . addLabels ( { ...ctx . repo ( ) , number : pr . number , labels : [ label ] } ) ;
282
+ const addLabelPromise = ctx . octokit . issues . addLabels ( { ...ctx . repo ( ) , number : pr . number , labels : [ label ] } ) ;
283
283
addLabelPromise . catch ( err => log . error ( err , "Error while adding label to PR" ) ) ;
284
284
}
285
285
} ) ;
@@ -297,14 +297,14 @@ export class GithubApp extends Probot {
297
297
const pr = ctx . payload . pull_request ;
298
298
const contextURL = pr . html_url ;
299
299
const button = `<a href="${ this . env . hostUrl . withContext ( contextURL ) } "><img src="${ this . getBadgeImageURL ( ) } "/></a>` ;
300
- const comments = await ( ( ctx . github as any ) . issues . listComments ( ctx . issue ( ) ) as Promise < any > ) ;
300
+ const comments = await ctx . octokit . issues . listComments ( ctx . issue ( ) ) ;
301
301
const existingComment = comments . data . find ( ( c : any ) => c . body . indexOf ( button ) > - 1 ) ;
302
302
if ( existingComment ) {
303
303
return ;
304
304
}
305
305
306
306
const newComment = ctx . issue ( { body : `\n\n${ button } \n\n` } ) ;
307
- const newCommentPromise : Promise < void > = ( ctx . github as any ) . issues . createComment ( newComment ) ;
307
+ const newCommentPromise = ctx . octokit . issues . createComment ( newComment ) ;
308
308
newCommentPromise . catch ( err => log . error ( err , "Error while adding new PR comment" , { contextURL } ) ) ;
309
309
}
310
310
0 commit comments