@@ -40,15 +40,6 @@ const (
40
40
OperationStatusError = "Error"
41
41
)
42
42
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
-
52
43
func getGitHubClient () (* github.Client , context.Context , error ) {
53
44
pat := os .Getenv ("INPUT_PAT" )
54
45
if len (pat ) == 0 {
@@ -159,22 +150,12 @@ func getPullRequestDetailsFromEnvironment(isDebugMode bool) (*PullRequestDetails
159
150
160
151
func submitPRDetailsAndGetCodeFeedback (prDetails * PullRequestDetails , isDebugMode bool ) (bool , error ) {
161
152
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
- }
172
153
173
154
apiClient := ApiClient {
174
155
Client : & http.Client {},
175
156
ApiBaseURI : APIEndpoint + "/v1/app/" ,
176
157
}
177
- response , err := apiClient .SubmitCodeReviewRequest (actionsJWT . Value , prDetails )
158
+ response , err := apiClient .SubmitCodeReviewRequest (prDetails )
178
159
if err != nil {
179
160
return responseReceived , fmt .Errorf ("error submitting code review request: %v" , err )
180
161
}
@@ -185,15 +166,7 @@ func submitPRDetailsAndGetCodeFeedback(prDetails *PullRequestDetails, isDebugMod
185
166
var reviewComments * CodeReviewCommentsResponse
186
167
187
168
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 )
197
170
if err != nil {
198
171
return responseReceived , fmt .Errorf ("error retrieving code review comments: %v" , err )
199
172
}
0 commit comments