mirror of
https://github.com/webfactory/ssh-agent.git
synced 2025-06-28 13:43:46 +00:00
Try to kill the ssh-agent upon action termination on Windows as well
This commit is contained in:
parent
384ccf693f
commit
d57d85f6f9
5 changed files with 82 additions and 42 deletions
10
cleanup.js
10
cleanup.js
|
@ -1,10 +1,12 @@
|
|||
const core = require('@actions/core')
|
||||
const { execSync } = require('child_process')
|
||||
const core = require('@actions/core');
|
||||
const { execSync } = require('child_process');
|
||||
const { sshAgent } = require('./paths.js');
|
||||
|
||||
try {
|
||||
// Kill the started SSH agent
|
||||
console.log('Stopping SSH agent')
|
||||
execSync('kill ${SSH_AGENT_PID}', { stdio: 'inherit' })
|
||||
console.log('Stopping SSH agent');
|
||||
execSync(sshAgent, ['-k'], { stdio: 'inherit' });
|
||||
|
||||
} catch (error) {
|
||||
console.log(error.message);
|
||||
console.log('Error stopping the SSH agent, proceeding anyway');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue