2
0
mirror of https://github.com/RouxAntoine/checkout.git synced 2024-12-29 05:57:21 +00:00

fix: resolve bug with path prefix on server url

Close Issue 1370
This commit is contained in:
RouxAntoine 2023-07-09 11:52:48 +02:00
parent cbb722410c
commit 5ed10d5a6f
Signed by: antoine
GPG Key ID: 098FB66FC0475E70
2 changed files with 2 additions and 2 deletions

2
dist/index.js vendored
View File

@ -2451,7 +2451,7 @@ function getFetchUrl(settings) {
return `${user}@${serviceUrl.hostname}:${encodedOwner}/${encodedName}.git`; return `${user}@${serviceUrl.hostname}:${encodedOwner}/${encodedName}.git`;
} }
// "origin" is SCHEME://HOSTNAME[:PORT] // "origin" is SCHEME://HOSTNAME[:PORT]
return `${serviceUrl.origin}/${encodedOwner}/${encodedName}`; return `${serviceUrl.origin}${serviceUrl.pathname}/${encodedOwner}/${encodedName}`;
} }
function getServerUrl(url) { function getServerUrl(url) {
let resolvedUrl = process.env['GITHUB_SERVER_URL'] || 'https://github.com'; let resolvedUrl = process.env['GITHUB_SERVER_URL'] || 'https://github.com';

View File

@ -17,7 +17,7 @@ export function getFetchUrl(settings: IGitSourceSettings): string {
} }
// "origin" is SCHEME://HOSTNAME[:PORT] // "origin" is SCHEME://HOSTNAME[:PORT]
return `${serviceUrl.origin}/${encodedOwner}/${encodedName}` return `${serviceUrl.origin}${serviceUrl.pathname}/${encodedOwner}/${encodedName}`
} }
export function getServerUrl(url?: string): URL { export function getServerUrl(url?: string): URL {