fix: persist agent pid in state instead

This commit is contained in:
Sn0wCrack 2024-09-19 15:09:27 +10:00
parent 7e185f2952
commit 5ade4b973d
No known key found for this signature in database
2 changed files with 6 additions and 2 deletions

View file

@ -14,7 +14,9 @@ async function cleanup() {
return
}
const sshAgentPid = core.getState('ssh-agent-pid')
// Remove all keys from ssh-agent and kill process
await $`ssh-add -D`
await $`kill \$SSH_AGENT_PID`
await $`kill ${sshAgentPid}`
}

View file

@ -38,7 +38,9 @@ async function ssh() {
}
core.exportVariable('SSH_AUTH_SOCK', sshAgentSocket.trim())
core.exportVariable('SSH_AGENT_PID', sshAgentProcessId.trim())
core.exportVariable('SSH_AGENT_PID', )
core.saveState('ssh-agent-pid', sshAgentProcessId.trim())
let privateKey = core.getInput('private-key')
if (privateKey !== '') {