getFetchUrl: compose url with full service url

actions/checkout maybe used by Gitea, which allows installing the
server instance in a subdirectory to the service root, therefore a full
serviceUrl must be used.

Signed-off-by: You-Sheng Yang <vicamo@gmail.com>
This commit is contained in:
You-Sheng Yang 2024-03-22 00:02:33 +08:00
parent cd7d8d697e
commit 9b92a3558d
2 changed files with 2 additions and 4 deletions

3
dist/index.js vendored
View file

@ -2402,8 +2402,7 @@ function getFetchUrl(settings) {
if (settings.sshKey) {
return `git@${serviceUrl.hostname}:${encodedOwner}/${encodedName}.git`;
}
// "origin" is SCHEME://HOSTNAME[:PORT]
return `${serviceUrl.origin}/${encodedOwner}/${encodedName}`;
return `${serviceUrl}/${encodedOwner}/${encodedName}`;
}
exports.getFetchUrl = getFetchUrl;
function getServerUrl(url) {

View file

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