mirror of
https://github.com/deployphp/action.git
synced 2025-04-01 19:06:35 +00:00
fix: persisting ssh agent pid in environment variable
chore: add comment explaining why we regex output
This commit is contained in:
parent
5ade4b973d
commit
50eb1df62e
1 changed files with 4 additions and 1 deletions
5
index.js
5
index.js
|
@ -21,6 +21,9 @@ async function ssh() {
|
|||
fs.mkdirSync(sshHomeDir)
|
||||
}
|
||||
|
||||
// Unfortunately running the output into bash or eval-ing it does
|
||||
// not persist the exported environment variables, so instead we
|
||||
// parse out the variables via regex, not ideal but works a treat.
|
||||
const sshAgentOutput = await $`ssh-agent`
|
||||
|
||||
const sshAgentSocket = sshAgentOutput
|
||||
|
@ -38,7 +41,7 @@ async function ssh() {
|
|||
}
|
||||
|
||||
core.exportVariable('SSH_AUTH_SOCK', sshAgentSocket.trim())
|
||||
core.exportVariable('SSH_AGENT_PID', )
|
||||
core.exportVariable('SSH_AGENT_PID', sshAgentProcessId.trim())
|
||||
|
||||
core.saveState('ssh-agent-pid', sshAgentProcessId.trim())
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue