1
0
Fork 0
mirror of https://code.forgejo.org/actions/checkout.git synced 2024-11-27 14:39:16 +01:00

Add build file

This commit is contained in:
Jakob 2023-09-08 00:11:37 +02:00
parent 13ef2cd8f1
commit e9130f8f55
No known key found for this signature in database

6
dist/index.js vendored
View file

@ -2371,14 +2371,16 @@ function getFetchUrl(settings) {
const encodedOwner = encodeURIComponent(settings.repositoryOwner);
const encodedName = encodeURIComponent(settings.repositoryName);
if (settings.sshKey) {
return `git@${serviceUrl.hostname}:${encodedOwner}/${encodedName}.git`;
return serviceUrl.port === ''
? `git@${serviceUrl.hostname}:${encodedOwner}/${encodedName}.git`
: `ssh://git@${serviceUrl.hostname}:${serviceUrl.port}/${encodedOwner}/${encodedName}.git`;
}
// "origin" is SCHEME://HOSTNAME[:PORT]
return `${serviceUrl.origin}/${encodedOwner}/${encodedName}`;
}
exports.getFetchUrl = getFetchUrl;
function getServerUrl(url) {
let urlValue = url && url.trim().length > 0
const urlValue = url && url.trim().length > 0
? url
: process.env['GITHUB_SERVER_URL'] || 'https://github.com';
return new url_1.URL(urlValue);