deployphp/cleanup.js
Sn0wCrack dca1d5d96c feat: start working on better self hosted runner support
essentially attempt to spawn ssh agent independently and kill it when the action is over
2024-09-19 13:18:38 +10:00

20 lines
375 B
JavaScript

import core from '@actions/core'
import { $ } from 'zx'
void (async function main() {
try {
await cleanup()
} catch (err) {
core.setFailed(err.message)
}
})()
async function cleanup() {
if (core.getBooleanInput('skip-ssh-setup')) {
return
}
// Remove all keys from ssh-agent and kill process
await $`ssh-add -D`
await $`kill \$SSH_AGENT_PID`
}