12
0
Fork 0
mirror of https://github.com/actions/checkout.git synced 2026-05-22 03:52:00 +00:00

allow for subpaths in GITHUB_SERVER_URL

This commit is contained in:
fx 2026-05-13 21:15:34 +02:00
parent 900f2210b1
commit b5005fef89
2 changed files with 7 additions and 2 deletions

3
dist/index.js vendored
View file

@ -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 serviceUrlBase = pruneSuffix(`${serviceUrl.origin}${serviceUrl.pathname}`, '/');
return `${serviceUrlBase}/${encodedOwner}/${encodedName}`;
}
function getServerUrl(url) {
let resolvedUrl = process.env['GITHUB_SERVER_URL'] || 'https://github.com';

View file

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