From 9dedf391b12c24b4e16ab53ac8d79bf6914418c9 Mon Sep 17 00:00:00 2001 From: harsh mahajan Date: Tue, 14 Jul 2026 15:53:02 +0530 Subject: [PATCH] Pass repositoryId to getOwnerName() for org-owned Gitea repos Without it, Gitea's adapter can't identify the owner via installationId (unused for Gitea) and falls back to the authenticated token's own username -- correct for a personal repo, wrong for an organization-owned one the user has push access to but doesn't personally own. GitHub's adapter explicitly ignores repositoryId (resolves owner via the App installation itself), so this is a no-op there. --- .../Platform/Modules/VCS/Http/GitHub/Deployment.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Appwrite/Platform/Modules/VCS/Http/GitHub/Deployment.php b/src/Appwrite/Platform/Modules/VCS/Http/GitHub/Deployment.php index 2a6f21bb4c..fb11603285 100644 --- a/src/Appwrite/Platform/Modules/VCS/Http/GitHub/Deployment.php +++ b/src/Appwrite/Platform/Modules/VCS/Http/GitHub/Deployment.php @@ -147,7 +147,7 @@ trait Deployment $activate = true; } - $owner = $vcs->getOwnerName($providerInstallationId); + $owner = $vcs->getOwnerName($providerInstallationId, (int) $providerRepositoryId); try { $repositoryName = $vcs->getRepositoryName($providerRepositoryId); } catch (RepositoryNotFound $e) { @@ -334,7 +334,7 @@ trait Deployment } catch (RepositoryNotFound $e) { throw new Exception(Exception::PROVIDER_REPOSITORY_NOT_FOUND); } - $owner = $vcs->getOwnerName($providerInstallationId); + $owner = $vcs->getOwnerName($providerInstallationId, (int) $providerRepositoryId); $vcs->updateCommitStatus($repositoryName, $providerCommitHash, $owner, 'pending', $message, $authorizeUrl, $name); continue; } @@ -566,7 +566,7 @@ trait Deployment } catch (RepositoryNotFound $e) { throw new Exception(Exception::PROVIDER_REPOSITORY_NOT_FOUND); } - $owner = $vcs->getOwnerName($providerInstallationId); + $owner = $vcs->getOwnerName($providerInstallationId, (int) $providerRepositoryId); $providerTargetUrl = $protocol . '://' . $hostname . "/console/project-$region-$projectId/$resourceCollection/$resourceType-$resourceId"; $vcs->updateCommitStatus($repositoryName, $providerCommitHash, $owner, 'pending', $message, $providerTargetUrl, $name);