Skip to content

Commit 90ef56d

Browse files
committed
fix: Ensure known_hosts directory exists before writing
- Added `mkdir -p` command to create the directory for `SSH_KNOWN_HOSTS_FILE` if it does not exist. - Prevents errors when attempting to write to a non-existent directory.
1 parent 3816620 commit 90ef56d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

action.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/env bash
22

3+
mkdir -p "$(dirname "${SSH_KNOWN_HOSTS_FILE}")"
4+
35
if [ -z "${SSH_HOST}" ] && [ -z "${SSH_KNOWN_HOSTS}" ]; then
46
echo ":error file=$(basename "$0"),line=${LINENO},endLine=${LINENO},title=Input validation::\
57
One of the input, 'ssh-host' or 'ssh-known-hosts' must be set. Please update your workflow inputs."

0 commit comments

Comments
 (0)