Skip to content

Commit

Permalink
fix: persisting ssh agent pid in environment variable
Browse files Browse the repository at this point in the history
chore: add comment explaining why we regex output
  • Loading branch information
Sn0wCrack committed Sep 19, 2024
1 parent 5ade4b9 commit 50eb1df
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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())

Expand Down

0 comments on commit 50eb1df

Please sign in to comment.