diff --git a/dist/index.js b/dist/index.js index fe3f317..1f16df0 100644 --- a/dist/index.js +++ b/dist/index.js @@ -2731,7 +2731,8 @@ function getFetchUrl(settings) { return `${user}@${serviceUrl.hostname}:${encodedOwner}/${encodedName}.git`; } // "origin" is SCHEME://HOSTNAME[:PORT] - return `${serviceUrl.origin}/${encodedOwner}/${encodedName}`; + const rootUrl = serviceUrl.origin + serviceUrl.pathname.replace(/\/$/, ''); + return `${rootUrl}/${encodedOwner}/${encodedName}`; } function getServerUrl(url) { let resolvedUrl = process.env['GITHUB_SERVER_URL'] || 'https://github.com'; diff --git a/src/url-helper.ts b/src/url-helper.ts index 17a0842..28eea28 100644 --- a/src/url-helper.ts +++ b/src/url-helper.ts @@ -17,7 +17,8 @@ export function getFetchUrl(settings: IGitSourceSettings): string { } // "origin" is SCHEME://HOSTNAME[:PORT] - return `${serviceUrl.origin}/${encodedOwner}/${encodedName}` + const rootUrl = serviceUrl.origin + serviceUrl.pathname.replace(/\/$/, '') + return `${rootUrl}/${encodedOwner}/${encodedName}` } export function getServerUrl(url?: string): URL {