mirror of
https://github.com/webfactory/ssh-agent.git
synced 2025-04-22 06:08:42 +00:00
19 lines
642 B
JavaScript
19 lines
642 B
JavaScript
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' })
|
|
|
|
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);
|
|
}
|
|
} catch (error) {
|
|
console.log(error.message);
|
|
console.log('Error stopping the SSH agent, proceeding anyway');
|
|
}
|