ssh-agent/cleanup.js
Thorben Nissen b05960c6f2 [FEATURE] Post step for cleaning up the SSH agent
* add `cleanup.js` for stopping the ssh-agent after the job is done
* add `scripts/build.js` to make it easier to build the files in `dist/`
* update README
* remove meaningless dependency `child_process` (its a node core package)
* update `@actions/core` to `^1.2.4`
2020-05-15 09:42:03 +02:00

10 lines
277 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' })
} catch (error) {
core.setFailed(error.message)
}