revert: "fix: do not convert ssh repositoryUrl to https"
This reverts commit b89523105c.
This commit is contained in:
+2
-10
@@ -47,18 +47,10 @@ module.exports = async ({cwd, env, options: {repositoryUrl, branch}}) => {
|
||||
const envVar = Object.keys(GIT_TOKENS).find(envVar => !isUndefined(env[envVar]));
|
||||
const gitCredentials = `${GIT_TOKENS[envVar] || ''}${env[envVar] || ''}`;
|
||||
const {protocols, ...parsed} = gitUrlParse(repositoryUrl);
|
||||
const protocol = protocols.includes('https')
|
||||
? 'https'
|
||||
: protocols.includes('http')
|
||||
? 'http'
|
||||
: protocols.includes('ssh')
|
||||
? 'ssh'
|
||||
: 'https';
|
||||
const protocol = protocols.includes('https') ? 'https' : protocols.includes('http') ? 'http' : 'https';
|
||||
|
||||
// If credentials are set via anvironment variables, convert the URL to http/https and add basic auth, otherwise return `repositoryUrl` as is
|
||||
return gitCredentials && ['https', 'http'].includes(protocol)
|
||||
? {...parsed, protocols: [protocol], user: gitCredentials}.toString(protocol)
|
||||
: repositoryUrl;
|
||||
return gitCredentials ? {...parsed, protocols: [protocol], user: gitCredentials}.toString(protocol) : repositoryUrl;
|
||||
}
|
||||
|
||||
return repositoryUrl;
|
||||
|
||||
Reference in New Issue
Block a user