From b5005fef897c6b358f05f7705c559af25624a49d Mon Sep 17 00:00:00 2001 From: fx Date: Wed, 13 May 2026 21:15:34 +0200 Subject: [PATCH] allow for subpaths in GITHUB_SERVER_URL --- dist/index.js | 3 ++- src/url-helper.ts | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index 57729b2..1bc1a10 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 serviceUrlBase = pruneSuffix(`${serviceUrl.origin}${serviceUrl.pathname}`, '/'); + return `${serviceUrlBase}/${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..862e5f3 100644 --- a/src/url-helper.ts +++ b/src/url-helper.ts @@ -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 {