Skip to content

Commit dc4dcfc

Browse files
authored
fix: always set GPTSCRIPT_CREDENTIAL_EXPIRATION env var when credentials are used (#727)
Signed-off-by: Grant Linville <[email protected]>
1 parent fb32c4c commit dc4dcfc

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Diff for: pkg/runner/runner.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -968,19 +968,19 @@ func (r *Runner) handleCredentials(callCtx engine.Context, monitor Monitor, env
968968
} else {
969969
log.Warnf("Not saving credential for tool %s - credentials will only be saved for tools from GitHub, or tools that use aliases.", toolName)
970970
}
971+
}
971972

972-
if c.ExpiresAt != nil && (nearestExpiration == nil || nearestExpiration.After(*c.ExpiresAt)) {
973-
nearestExpiration = c.ExpiresAt
974-
}
973+
if c.ExpiresAt != nil && (nearestExpiration == nil || nearestExpiration.After(*c.ExpiresAt)) {
974+
nearestExpiration = c.ExpiresAt
975975
}
976976

977977
for k, v := range c.Env {
978978
env = append(env, fmt.Sprintf("%s=%s", k, v))
979979
}
980+
}
980981

981-
if nearestExpiration != nil {
982-
env = append(env, fmt.Sprintf("%s=%s", credentials.CredentialExpiration, nearestExpiration.Format(time.RFC3339)))
983-
}
982+
if nearestExpiration != nil {
983+
env = append(env, fmt.Sprintf("%s=%s", credentials.CredentialExpiration, nearestExpiration.Format(time.RFC3339)))
984984
}
985985

986986
return env, nil

0 commit comments

Comments
 (0)