2020-05-18 09:08:29 +02:00
|
|
|
const core = require('@actions/core')
|
|
|
|
const { execSync } = require('child_process')
|
|
|
|
|
|
|
|
try {
|
|
|
|
// Kill the started SSH agent
|
|
|
|
console.log('Stopping SSH agent')
|
|
|
|
execSync('kill ${SSH_AGENT_PID}', { stdio: 'inherit' })
|
2020-11-23 21:58:33 -07:00
|
|
|
|
|
|
|
const home = process.env['HOME'];
|
|
|
|
const homeSsh = `${home}/.ssh`;
|
|
|
|
const gitSSHWrapperPath = path.join(homeSsh, 'git-deploy-key-wrapper.sh');
|
|
|
|
if (fs.existsSync(gitSSHWrapperPath)) {
|
|
|
|
console.log('Removing ssh git SSH wrapper');
|
|
|
|
fs.unlinkSync(gitSSHWrapperPath);
|
|
|
|
}
|
2020-05-18 09:08:29 +02:00
|
|
|
} catch (error) {
|
2020-06-24 08:31:28 +02:00
|
|
|
console.log(error.message);
|
|
|
|
console.log('Error stopping the SSH agent, proceeding anyway');
|
2020-05-18 09:08:29 +02:00
|
|
|
}
|