diff --git a/src/executor/runner.js b/src/executor/runner.js index da875ad..c0e6873 100644 --- a/src/executor/runner.js +++ b/src/executor/runner.js @@ -735,11 +735,11 @@ export async function runConfigSubdomain(config, domaindata, subdomain, sshExec, if (source.credentials?.github?.ssh) { const configFileContent = `Host github.com\n\tStrictHostKeyChecking no\n\tIdentityFile ~/.ssh/id_github_com\n`; await writeLog("$> writing SSH private key for cloning github.com repository"); - await sshExec(`mkdir -p ~/.ssh; touch $HOME/.ssh/{id_github_com,config}; chmod 0600 $HOME/.ssh/*`); - await sshExec(`echo "${Buffer.from(source.credentials.github.ssh).toString('base64')}" | base64 --decode > $HOME/.ssh/config`, true); + await sshExec(`mkdir -p ~/.ssh; touch $HOME/.ssh/{id_github_com,config}; chmod 0600 $HOME/.ssh/*`, false); + await sshExec(`echo "${Buffer.from(source.credentials.github.ssh).toString('base64')}" | base64 --decode > $HOME/.ssh/id_github_com`, false); // delete old config https://stackoverflow.com/a/36111659/3908409 - await sshExec(`sed 's/^Host/\\n&/' $HOME/.ssh/config | sed '/^Host '"github.com"'$/,/^$/d;/^$/d' > $HOME/.ssh/config`, true); - await sshExec(`echo "${Buffer.from(configFileContent).toString('base64')}" | base64 --decode >> ~/.ssh/config`, true); + await sshExec(`sed 's/^Host/\\n&/' $HOME/.ssh/config | sed '/^Host '"github.com"'$/,/^$/d;/^$/d' > $HOME/.ssh/config`, false); + await sshExec(`echo "${Buffer.from(configFileContent).toString('base64')}" | base64 --decode >> ~/.ssh/config`, false); } executedCMD.push(`git clone ${escapeShell(url.toString())}` + `${source.branch ? ` -b ${escapeShell(source.branch)}` : ''}` +