From 8aced5df8ac8e0d1467c5120cfaa494ed8d5ac30 Mon Sep 17 00:00:00 2001 From: Corentin Flr <10946971+cogk@users.noreply.github.com> Date: Mon, 20 May 2024 11:04:27 +0200 Subject: [PATCH] fix(app_release): Add GitLab token to repo URL --- press/press/doctype/app_release/app_release.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/press/press/doctype/app_release/app_release.py b/press/press/doctype/app_release/app_release.py index 28ab8a17f55..b26564b1b57 100644 --- a/press/press/doctype/app_release/app_release.py +++ b/press/press/doctype/app_release/app_release.py @@ -152,6 +152,9 @@ def _clone_repo(self): self.output += self.run(f"git reset --hard {self.hash}") def _get_repo_url(self, source: "AppSource") -> str: + if source.get("gitlab_access_token"): + return source.repository_url.replace("https://", f"https://oauth2:{source.get_password('gitlab_access_token')}@") + if not source.github_installation_id: return source.repository_url