Compare commits

...

2 Commits

Author SHA1 Message Date
Ansis Māliņš ead4444264
Merge 2cc0dd4921 into 1cce3390c2 2026-06-02 01:28:23 +05:30
Ansis Māliņš 2cc0dd4921 fix: handle Forgejo instances at subpaths 2026-04-11 12:14:02 +02:00
2 changed files with 4 additions and 2 deletions

3
dist/index.js vendored
View File

@ -2780,7 +2780,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';

View File

@ -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 {