@@ -61,7 +61,7 @@ export const compileGithubConfig = async (
6161 const gitHubRepos = gitHubReposResult . repos ;
6262 const warnings = gitHubReposResult . warnings ;
6363
64- const hostUrl = config . url ?? 'https://github.com' ;
64+ const hostUrl = ( config . url ?? 'https://github.com' ) . replace ( / \/ + $ / , '' ) ;
6565
6666 const repos = gitHubRepos . map ( ( repo ) => {
6767 const record = createGitHubRepoRecord ( {
@@ -242,7 +242,7 @@ export const compileGiteaConfig = async (
242242 const giteaRepos = giteaReposResult . repos ;
243243 const warnings = giteaReposResult . warnings ;
244244
245- const hostUrl = config . url ?? 'https://gitea.com' ;
245+ const hostUrl = ( config . url ?? 'https://gitea.com' ) . replace ( / \/ + $ / , '' ) ;
246246 const repoNameRoot = new URL ( hostUrl )
247247 . toString ( )
248248 . replace ( / ^ h t t p s ? : \/ \/ / , '' ) ;
@@ -309,7 +309,7 @@ export const compileGerritConfig = async (
309309 connectionId : number ) : Promise < CompileResult > => {
310310
311311 const gerritRepos = await getGerritReposFromConfig ( config ) ;
312- const hostUrl = config . url ;
312+ const hostUrl = config . url . replace ( / \/ + $ / , '' ) ;
313313 const repoNameRoot = new URL ( hostUrl )
314314 . toString ( )
315315 . replace ( / ^ h t t p s ? : \/ \/ / , '' ) ;
@@ -396,7 +396,7 @@ export const compileBitbucketConfig = async (
396396 const bitbucketRepos = bitbucketReposResult . repos ;
397397 const warnings = bitbucketReposResult . warnings ;
398398
399- const hostUrl = config . url ?? 'https://bitbucket.org' ;
399+ const hostUrl = ( config . url ?? 'https://bitbucket.org' ) . replace ( / \/ + $ / , '' ) ;
400400 const repoNameRoot = new URL ( hostUrl )
401401 . toString ( )
402402 . replace ( / ^ h t t p s ? : \/ \/ / , '' ) ;
0 commit comments