diff --git a/packages/server/src/utils/providers/gitlab.ts b/packages/server/src/utils/providers/gitlab.ts index e8e4af2a5..a14067fba 100644 --- a/packages/server/src/utils/providers/gitlab.ts +++ b/packages/server/src/utils/providers/gitlab.ts @@ -90,12 +90,14 @@ const getGitlabRepoClone = ( gitlab: GitlabInfo, gitlabPathNamespace: string | null, ) => { - const repoClone = `${gitlab?.gitlabUrl.replace(/^https?:\/\//, "")}/${gitlabPathNamespace}.git`; + const url = gitlab?.gitlabInternalUrl || gitlab?.gitlabUrl; + const repoClone = `${url?.replace(/^https?:\/\//, "")}/${gitlabPathNamespace}.git`; return repoClone; }; const getGitlabCloneUrl = (gitlab: GitlabInfo, repoClone: string) => { - const isSecure = gitlab?.gitlabUrl.startsWith("https://"); + const url = gitlab?.gitlabInternalUrl || gitlab?.gitlabUrl; + const isSecure = url?.startsWith("https://"); const cloneUrl = `http${isSecure ? "s" : ""}://oauth2:${gitlab?.accessToken}@${repoClone}`; return cloneUrl; };