From ab3d28954a9cc0cc158e97e8c083b02c6e6a7ddc Mon Sep 17 00:00:00 2001 From: Hemachandar Date: Mon, 2 Mar 2026 11:11:30 +0530 Subject: [PATCH] use new API --- composer.lock | 14 +++++++------- .../VCS/Http/Installations/Repositories/Get.php | 9 +++++---- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/composer.lock b/composer.lock index 7065be335c..619c34ea9f 100644 --- a/composer.lock +++ b/composer.lock @@ -5215,16 +5215,16 @@ }, { "name": "utopia-php/vcs", - "version": "2.0.0", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/utopia-php/vcs.git", - "reference": "058049326e04a2a0c2f0ce8ad00c7e84825aba14" + "reference": "92a1650824ba0c5e6a1bc46e622ac87c50a08920" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/vcs/zipball/058049326e04a2a0c2f0ce8ad00c7e84825aba14", - "reference": "058049326e04a2a0c2f0ce8ad00c7e84825aba14", + "url": "https://api.github.com/repos/utopia-php/vcs/zipball/92a1650824ba0c5e6a1bc46e622ac87c50a08920", + "reference": "92a1650824ba0c5e6a1bc46e622ac87c50a08920", "shasum": "" }, "require": { @@ -5258,9 +5258,9 @@ ], "support": { "issues": "https://github.com/utopia-php/vcs/issues", - "source": "https://github.com/utopia-php/vcs/tree/2.0.0" + "source": "https://github.com/utopia-php/vcs/tree/2.0.1" }, - "time": "2026-02-25T11:36:45+00:00" + "time": "2026-02-27T12:18:49+00:00" }, { "name": "utopia-php/websocket", @@ -9067,5 +9067,5 @@ "platform-overrides": { "php": "8.3" }, - "plugin-api-version": "2.9.0" + "plugin-api-version": "2.6.0" } diff --git a/src/Appwrite/Platform/Modules/VCS/Http/Installations/Repositories/Get.php b/src/Appwrite/Platform/Modules/VCS/Http/Installations/Repositories/Get.php index 835ee0f95b..9e32ca8276 100644 --- a/src/Appwrite/Platform/Modules/VCS/Http/Installations/Repositories/Get.php +++ b/src/Appwrite/Platform/Modules/VCS/Http/Installations/Repositories/Get.php @@ -86,12 +86,13 @@ class Get extends Action $repository = $github->getRepository($owner, $repositoryName); $authorized = false; - ['items' => $repos] = $github->searchRepositories($providerInstallationId, $owner, 1, 25, $repositoryName); - foreach ($repos as $repo) { - if (\strval($repo['id']) === $providerRepositoryId) { + try { + $installationRepository = $github->getInstallationRepository($repositoryName); + if (!empty($installationRepository)) { $authorized = true; - break; } + } catch (RepositoryNotFound $e) { + $authorized = false; } $repository['id'] = \strval($repository['id']) ?? '';