Scope GitHub App installation queries by provider

Both share the installations collection with Gitea now. Without a
provider filter, a numeric providerInstallationId collision between a
GitHub App installation and a Gitea installation (for the same
project, or across projects for the installation.deleted handler)
would silently match the wrong document -- overwriting a Gitea
installation on callback, or deleting one along with its connected
functions/sites/repositories on installation.deleted.
This commit is contained in:
harsh mahajan committed 2026-07-15 17:48:23 +05:30
1 parent 81969cc1bb
commit 752b274c0c
2 files changed
+3 -1

No files matched your search

@@ -111,7 +111,8 @@ class Get extends Action
$installation = $dbForPlatform->findOne('installations', [
Query::equal('providerInstallationId', [$providerInstallationId]),
Query::equal('projectInternalId', [$projectInternalId])
Query::equal('projectInternalId', [$projectInternalId]),
Query::equal('provider', ['github'])
]);
$personal = false;
@@ -113,6 +113,7 @@ class Create extends Action
do {
$installationQueries = [
Query::equal('providerInstallationId', [$providerInstallationId]),
Query::equal('provider', ['github']),
Query::limit(1000),
];
if ($installationCursor !== null) {