fix: guard disconnectVcs against stale deployment overwriting reconnected installation

This commit is contained in:
harsh mahajan committed 2026-06-24 17:47:26 +05:30
1 parent 317f7515bb
commit f5bb65f50e
1 file changed
+2 -1
@@ -298,7 +298,8 @@ class Builds extends Action
try {
$github->initializeVariables($providerInstallationId, $privateKey, $githubAppId);
} catch (\Exception $e) {
if (\str_contains($e->getMessage(), 'Status: 404')) {
if (\str_contains($e->getMessage(), 'Status: 404')
&& $resource->getAttribute('installationId', '') === $installationId) {
$this->disconnectVcs($resource, $dbForProject, $dbForPlatform);
}
throw $e;