From a03ef9dd26436527823f74c58a1eaf124bdd6fe1 Mon Sep 17 00:00:00 2001 From: Turtle Kalus Date: Mon, 22 May 2023 23:34:41 -0700 Subject: [PATCH] fix: Add Cmd Default/Input support to cleanup Bring `post` actions step into consistency with `main` for changes introduced in #154 Without this change, `sshAgentCmd` is undefined when passed to `execFileSync()` during `cleanup` and `post` is never successful. --- cleanup.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cleanup.js b/cleanup.js index 6b7ab7d..a0ffe37 100644 --- a/cleanup.js +++ b/cleanup.js @@ -1,8 +1,10 @@ const core = require('@actions/core'); const { execFileSync } = require('child_process'); -const { sshAgentCmd } = require('./paths.js'); +const { sshAgentCmdDefault } = require('./paths.js'); try { + const sshAgentCmdInput = core.getInput('ssh-agent-cmd'); + const sshAgentCmd = sshAgentCmdInput ? sshAgentCmdInput : sshAgentCmdDefault; // Kill the started SSH agent console.log('Stopping SSH agent'); execFileSync(sshAgentCmd, ['-k'], { stdio: 'inherit' });