fix(github): check clock skew only from failed GitHub App responses

Stop calling /zen before each installation token request. A short
network problem to GitHub failed deployments with a cURL timeout on
/zen. assertGithubClockInSync now takes the failed response and reads
its Date header, so the "System time is out of sync" error still shows
when GitHub rejects the JWT.

Call it on failed JWT requests in the webhook installation check, the
permission job, the source connection test, and the server transfer
checklist. Remove the /zen fakes from the tests.
This commit is contained in:
Andras Bacsai
2026-11-03 19:29:45 +01:00
parent 7f521e496d
commit b7a2c75739
18 changed files with 54 additions and 80 deletions
+3
View File
@@ -841,6 +841,9 @@ class Github extends Controller
])
->timeout(10)
->get("{$github_app->api_url}/app/installations/{$installation_id}");
if (! $response->successful()) {
assertGithubClockInSync($response);
}
} catch (\Throwable $e) {
return strip_tags(str_replace('<br>', ' ', $e->getMessage()));
}