Skip to content

Commit

Permalink
fix: Add Cmd Default/Input support to cleanup
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tkalus committed Mar 4, 2024
1 parent dc588b6 commit a03ef9d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cleanup.js
Original file line number Diff line number Diff line change
@@ -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' });
Expand Down

0 comments on commit a03ef9d

Please sign in to comment.