@@ -40,15 +40,6 @@ const (
4040	OperationStatusError       =  "Error" 
4141)
4242
43- func  getTokenRemainingValidity (timestamp  interface {}) float64  {
44- 	if  validity , ok  :=  timestamp .(float64 ); ok  {
45- 		tm  :=  time .Unix (int64 (validity ), 0 )
46- 		remainder  :=  time .Until (tm )
47- 		return  remainder .Seconds ()
48- 	}
49- 	return  0 
50- }
51- 
5243func  getGitHubClient () (* github.Client , context.Context , error ) {
5344	pat  :=  os .Getenv ("INPUT_PAT" )
5445	if  len (pat ) ==  0  {
@@ -159,22 +150,12 @@ func getPullRequestDetailsFromEnvironment(isDebugMode bool) (*PullRequestDetails
159150
160151func  submitPRDetailsAndGetCodeFeedback (prDetails  * PullRequestDetails , isDebugMode  bool ) (bool , error ) {
161152	responseReceived  :=  false 
162- 	audience  :=  APIEndpoint 
163- 	oidcClient , err  :=  DefaultOIDCClient (audience )
164- 	if  err  !=  nil  {
165- 		return  responseReceived , fmt .Errorf ("error generating OIDC auth token. error:%v" , err )
166- 	}
167- 
168- 	actionsJWT , exp , err  :=  getActionsJWTAndExp (oidcClient , isDebugMode )
169- 	if  err  !=  nil  {
170- 		return  responseReceived , fmt .Errorf ("error generating OIDC auth token. error:%v" , err )
171- 	}
172153
173154	apiClient  :=  ApiClient {
174155		Client :     & http.Client {},
175156		ApiBaseURI : APIEndpoint  +  "/v1/app/" ,
176157	}
177- 	response , err  :=  apiClient .SubmitCodeReviewRequest (actionsJWT . Value ,  prDetails )
158+ 	response , err  :=  apiClient .SubmitCodeReviewRequest (prDetails )
178159	if  err  !=  nil  {
179160		return  responseReceived , fmt .Errorf ("error submitting code review request: %v" , err )
180161	}
@@ -185,15 +166,7 @@ func submitPRDetailsAndGetCodeFeedback(prDetails *PullRequestDetails, isDebugMod
185166	var  reviewComments  * CodeReviewCommentsResponse 
186167
187168	for  i  :=  0 ; i  <  20  &&  ! responseReceived ; i ++  {
188- 		remainder  :=  getTokenRemainingValidity (exp )
189- 		if  remainder  <  60  {
190- 			githubactions .Infof ("Renewing OIDC token as it's only valid for %f" , remainder )
191- 			actionsJWT , exp , err  =  getActionsJWTAndExp (oidcClient , isDebugMode )
192- 			if  err  !=  nil  {
193- 				return  responseReceived , fmt .Errorf ("error renewing OIDC token. Error: %v" , err )
194- 			}
195- 		}
196- 		reviewComments , err  =  apiClient .GetCodeReviewComments (actionsJWT .Value , response )
169+ 		reviewComments , err  =  apiClient .GetCodeReviewComments (response )
197170		if  err  !=  nil  {
198171			return  responseReceived , fmt .Errorf ("error retrieving code review comments: %v" , err )
199172		}
0 commit comments