From e71bec65f2f4cc38d0e78b60d8810d086e9717e2 Mon Sep 17 00:00:00 2001 From: harsh mahajan Date: Tue, 14 Jul 2026 18:59:11 +0530 Subject: [PATCH] Replace generic APP_VCS_COMMIT_* aliases with a real Gitea constant APP_VCS_COMMIT_USERNAME/URL were dead code (zero usages), and APP_VCS_COMMIT_EMAIL was just an alias for APP_VCS_GITHUB_EMAIL -- meaning Gitea's self-commit check was silently comparing a Gitea commit's author against GitHub's bot identity, which a real Gitea commit could never match. Add a real APP_VCS_GITEA_EMAIL instead of a fake-generic alias; Gitea has no bot-commit-push flow yet, so username/url aren't needed until it does. --- app/init/constants.php | 7 ++++--- .../Platform/Modules/VCS/Http/Gitea/Events/Create.php | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/init/constants.php b/app/init/constants.php index c90db28043..8268088ffe 100644 --- a/app/init/constants.php +++ b/app/init/constants.php @@ -108,9 +108,10 @@ const APP_SDK_PLATFORM_STATIC = 'static'; const APP_VCS_GITHUB_USERNAME = 'Appwrite'; const APP_VCS_GITHUB_EMAIL = 'team@appwrite.io'; const APP_VCS_GITHUB_URL = 'https://github.com/TeamAppwrite'; -const APP_VCS_COMMIT_USERNAME = APP_VCS_GITHUB_USERNAME; -const APP_VCS_COMMIT_EMAIL = APP_VCS_GITHUB_EMAIL; -const APP_VCS_COMMIT_URL = APP_VCS_GITHUB_URL; +// Gitea has no bot-commit-push flow yet (unlike GitHub's classic template +// merge), so only the email is needed, to detect Appwrite's own commits and +// skip re-triggering a build on them. +const APP_VCS_GITEA_EMAIL = 'team@appwrite.io'; const APP_BRANDED_EMAIL_BASE_TEMPLATE = 'email-base-styled'; // Embeddings diff --git a/src/Appwrite/Platform/Modules/VCS/Http/Gitea/Events/Create.php b/src/Appwrite/Platform/Modules/VCS/Http/Gitea/Events/Create.php index 62e86483aa..82bdc51b62 100644 --- a/src/Appwrite/Platform/Modules/VCS/Http/Gitea/Events/Create.php +++ b/src/Appwrite/Platform/Modules/VCS/Http/Gitea/Events/Create.php @@ -140,7 +140,7 @@ class Create extends Action Span::add('vcs.gitea.event.repo.name', $providerRepositoryName); Span::add('vcs.gitea.event.branch', $providerBranch); - if ($providerCommitAuthorEmail === APP_VCS_COMMIT_EMAIL || $providerBranchDeleted) { + if ($providerCommitAuthorEmail === APP_VCS_GITEA_EMAIL || $providerBranchDeleted) { return; }