@@ -274,15 +274,9 @@ const octokit_client_1 = __nccwpck_require__(40);
274
274
const util_1 = __nccwpck_require__ ( 669 ) ;
275
275
class GitHubHelper {
276
276
constructor ( token ) {
277
- const options = { } ;
278
- if ( token ) {
279
- options . auth = `${ token } ` ;
280
- }
281
- this . octokit = new octokit_client_1 . Octokit ( options ) ;
282
- this . graphqlClient = octokit_client_1 . graphql . defaults ( {
283
- headers : {
284
- authorization : `token ${ token } `
285
- }
277
+ this . octokit = new octokit_client_1 . Octokit ( {
278
+ auth : token ,
279
+ baseUrl : process . env [ 'GITHUB_API_URL' ] || 'https://api.github.com'
286
280
} ) ;
287
281
}
288
282
parseRepository ( repository ) {
@@ -306,7 +300,7 @@ class GitHubHelper {
306
300
}
307
301
}
308
302
}` ;
309
- const collaboratorPermission = yield this . graphqlClient ( query , Object . assign ( Object . assign ( { } , repo ) , { collaborator : actor } ) ) ;
303
+ const collaboratorPermission = yield this . octokit . graphql ( query , Object . assign ( Object . assign ( { } , repo ) , { collaborator : actor } ) ) ;
310
304
core . debug ( `CollaboratorPermission: ${ util_1 . inspect ( collaboratorPermission . repository . collaborators . edges ) } ` ) ;
311
305
return collaboratorPermission . repository . collaborators . edges . length > 0
312
306
? collaboratorPermission . repository . collaborators . edges [ 0 ] . permission . toLowerCase ( )
@@ -576,13 +570,11 @@ run();
576
570
"use strict" ;
577
571
578
572
Object . defineProperty ( exports , "__esModule" , ( { value : true } ) ) ;
579
- exports . graphql = exports . Octokit = void 0 ;
573
+ exports . Octokit = void 0 ;
580
574
const core_1 = __nccwpck_require__ ( 762 ) ;
581
575
const plugin_paginate_rest_1 = __nccwpck_require__ ( 193 ) ;
582
576
const plugin_rest_endpoint_methods_1 = __nccwpck_require__ ( 44 ) ;
583
577
exports . Octokit = core_1 . Octokit . plugin ( plugin_paginate_rest_1 . paginateRest , plugin_rest_endpoint_methods_1 . restEndpointMethods ) ;
584
- var graphql_1 = __nccwpck_require__ ( 668 ) ;
585
- Object . defineProperty ( exports , "graphql" , ( { enumerable : true , get : function ( ) { return graphql_1 . graphql ; } } ) ) ;
586
578
587
579
588
580
/***/ } ) ,
0 commit comments