fix(webhook): match manual webhook repositories case-insensitively

Git hosts treat owner/repo names case-insensitively, but the exact
repository match used a case-sensitive comparison, so a payload whose
casing differed from the stored git remote would fail to match and
skip a legitimate deployment.

Lowercase both canonical repository paths before comparing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Andras Bacsai
2026-05-22 15:59:20 +02:00
parent 941dbfd988
commit 809d9b21fa
2 changed files with 30 additions and 1 deletions
@@ -42,7 +42,13 @@ trait MatchesManualWebhookApplications
{
$repositoryPath = $this->canonicalManualWebhookRepository($gitRepository);
return $repositoryPath !== null && hash_equals($fullName, $repositoryPath);
if ($repositoryPath === null) {
return false;
}
// Git hosts (GitHub, GitLab, Gitea, Bitbucket) treat owner/repo names
// case-insensitively, so compare the canonical paths case-insensitively.
return hash_equals(mb_strtolower($fullName), mb_strtolower($repositoryPath));
}
/**