Fix GitLab webhook repo not matching with capital letters

This commit is contained in:
rubenwardy
2025-07-02 23:01:43 +01:00
parent 1928a2302c
commit cbb59e5e55
2 changed files with 2 additions and 1 deletions

View File

@@ -20,6 +20,7 @@ from app.models import Package, APIToken, Permission, PackageState
def get_packages_for_vcs_and_token(token: APIToken, repo_url: str) -> list[Package]:
repo_url = repo_url.replace("https://", "").replace("http://", "").lower()
if token.package:
packages = [token.package]
if not token.package.check_perm(token.owner, Permission.APPROVE_RELEASE):

View File

@@ -38,7 +38,7 @@ def webhook_impl():
if token is None:
return error(403, "Invalid authentication")
packages = get_packages_for_vcs_and_token(token, json["project"]["web_url"].replace("https://", "").replace("http://", ""))
packages = get_packages_for_vcs_and_token(token, json["project"]["web_url"])
for package in packages:
#
# Check event