@@ -135,9 +135,10 @@ export class GitHubService {
135135 * It logs details about the token creation process, including repository selection and permissions.
136136 * The token is scoped based on the provided repositories or the entire installation if no repositories are specified.
137137 */
138- async getInstallationToken ( jwtToken : string , installationId : number , repositories : string [ ] = [ ] , permissions ?: { [ key : string ] : string } ) : Promise < string > {
138+ async getInstallationToken ( jwtToken : string , installationId : number , repositories : string [ ] = [ ] , permissions ?: { [ key : string ] : string } ) : Promise < { token : string ; expiresAt : string } > {
139139 let groupName = '' ;
140140 let token = '' ;
141+ let expiresAt = '' ;
141142 if ( repositories . length > 0 ) {
142143 groupName = `##[group]Create installation token for repositories: ${ repositories } with ${ installationId } ` ;
143144 } else {
@@ -167,10 +168,11 @@ export class GitHubService {
167168 ) ;
168169
169170 token = response . data . token ;
171+ expiresAt = response . data . expires_at ;
170172
171173 this . dumpHeaders ( response . headers ) ;
172174
173- tl . debug ( `Expires: ${ response . data . expires_at } ` ) ;
175+ tl . debug ( `Expires: ${ expiresAt } ` ) ;
174176 console . log ( `Repository selection: ${ response . data . repository_selection } ` ) ;
175177 const permissionsCsv = this . formatPermissions ( response . data . permissions ) ;
176178 console . log ( `Permissions: ${ permissionsCsv } ` ) ;
@@ -179,7 +181,7 @@ export class GitHubService {
179181 console . log ( '##[endgroup]' )
180182 }
181183
182- return token ;
184+ return { token, expiresAt } ;
183185 }
184186
185187 async revokeInstallationToken ( token : string ) : Promise < boolean > {
0 commit comments