File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -110,23 +110,16 @@ export class GithubService {
110110 ) } )`,
111111 ) ;
112112
113- let storedIdentity : Identity | undefined ;
114-
115- if ( stateLockRequest && stateLockRequest . identity ) {
116- const { pk, sk } = stateLockRequest . identity ;
117-
118- const identity = await this . identityModel . model . get ( pk , sk ) ;
119-
120- if ( identity ) {
121- storedIdentity = identity . attrs ;
122- }
123- }
113+ const storedIdentity = await this . identityModel . model . get (
114+ IdentityModel . prefix ( 'pk' , tokenSha ) ,
115+ IdentityModel . prefix ( 'sk' ) ,
116+ ) ;
124117
125118 if ( storedIdentity && stateLockRequest && stateLockRequest . Operation === 'OperationTypeApply' ) {
126119 // Terraform planfiles contain credentials from plan operations
127120 // Return the previously known identity from the plan operation
128121 console . log ( `Found previously known identity (sha: ${ tokenSha } )` ) ;
129- return { ...storedIdentity , workspace : workspace || 'default' } ;
122+ return { ...storedIdentity . attrs , workspace : workspace || 'default' } ;
130123 }
131124
132125 const octokit = new Octokit ( { auth } ) ;
You can’t perform that action at this time.
0 commit comments