mirror of
https://github.com/deployphp/action.git
synced 2025-04-02 19:36:35 +00:00
fix: persist agent pid in state instead
This commit is contained in:
parent
7e185f2952
commit
5ade4b973d
2 changed files with 6 additions and 2 deletions
|
@ -14,7 +14,9 @@ async function cleanup() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const sshAgentPid = core.getState('ssh-agent-pid')
|
||||||
|
|
||||||
// Remove all keys from ssh-agent and kill process
|
// Remove all keys from ssh-agent and kill process
|
||||||
await $`ssh-add -D`
|
await $`ssh-add -D`
|
||||||
await $`kill \$SSH_AGENT_PID`
|
await $`kill ${sshAgentPid}`
|
||||||
}
|
}
|
||||||
|
|
4
index.js
4
index.js
|
@ -38,7 +38,9 @@ async function ssh() {
|
||||||
}
|
}
|
||||||
|
|
||||||
core.exportVariable('SSH_AUTH_SOCK', sshAgentSocket.trim())
|
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')
|
let privateKey = core.getInput('private-key')
|
||||||
if (privateKey !== '') {
|
if (privateKey !== '') {
|
||||||
|
|
Loading…
Add table
Reference in a new issue