mirror of
https://github.com/actions/checkout
synced 2024-11-14 09:11:41 +00:00
Add build file
This commit is contained in:
parent
13ef2cd8f1
commit
e9130f8f55
1 changed files with 4 additions and 2 deletions
6
dist/index.js
vendored
6
dist/index.js
vendored
|
@ -2371,14 +2371,16 @@ function getFetchUrl(settings) {
|
||||||
const encodedOwner = encodeURIComponent(settings.repositoryOwner);
|
const encodedOwner = encodeURIComponent(settings.repositoryOwner);
|
||||||
const encodedName = encodeURIComponent(settings.repositoryName);
|
const encodedName = encodeURIComponent(settings.repositoryName);
|
||||||
if (settings.sshKey) {
|
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]
|
// "origin" is SCHEME://HOSTNAME[:PORT]
|
||||||
return `${serviceUrl.origin}/${encodedOwner}/${encodedName}`;
|
return `${serviceUrl.origin}/${encodedOwner}/${encodedName}`;
|
||||||
}
|
}
|
||||||
exports.getFetchUrl = getFetchUrl;
|
exports.getFetchUrl = getFetchUrl;
|
||||||
function getServerUrl(url) {
|
function getServerUrl(url) {
|
||||||
let urlValue = url && url.trim().length > 0
|
const urlValue = url && url.trim().length > 0
|
||||||
? url
|
? url
|
||||||
: process.env['GITHUB_SERVER_URL'] || 'https://github.com';
|
: process.env['GITHUB_SERVER_URL'] || 'https://github.com';
|
||||||
return new url_1.URL(urlValue);
|
return new url_1.URL(urlValue);
|
||||||
|
|
Loading…
Reference in a new issue