diff --git a/src/Appwrite/Platform/Modules/VCS/Http/GitHub/Deployment.php b/src/Appwrite/Platform/Modules/VCS/Http/GitHub/Deployment.php index 6e1db12c28..79e53265a6 100644 --- a/src/Appwrite/Platform/Modules/VCS/Http/GitHub/Deployment.php +++ b/src/Appwrite/Platform/Modules/VCS/Http/GitHub/Deployment.php @@ -69,7 +69,9 @@ trait Deployment $project = $authorization->skip(fn () => $dbForPlatform->getDocument('projects', $projectId)); if ($project->isEmpty()) { - throw new Exception(Exception::PROJECT_NOT_FOUND, 'Repository references non-existent project'); + Console::warning("Repository {$repositoryId} references non-existent project {$projectId}, cleaning up"); + $authorization->skip(fn () => $dbForPlatform->deleteDocument('repositories', $repositoryId)); + continue; } $this->beforeCreateGitDeployment($project, $repository, $dbForPlatform, $authorization);