fix: replace tilde with $HOME for consistent path usage in scripts

This commit is contained in:
Burnett01 2025-09-01 16:11:00 +00:00
parent 61419b36d6
commit e0b7fb752e
5 changed files with 7 additions and 7 deletions

View file

@ -2,4 +2,4 @@
set -euo pipefail
printf '%s\n' "$@" >> ~/.ssh/known_hosts
printf '%s\n' "$@" >> $HOME/.ssh/known_hosts

View file

@ -2,4 +2,4 @@
set -euo pipefail
truncate -s 0 ~/.ssh/known_hosts
truncate -s 0 $HOME/.ssh/known_hosts

View file

@ -2,5 +2,5 @@
set -euo pipefail
touch ~/.ssh/known_hosts
chmod 600 ~/.ssh/known_hosts
touch $HOME/.ssh/known_hosts
chmod 600 $HOME/.ssh/known_hosts

View file

@ -2,4 +2,4 @@
set -euo pipefail
mkdir -m 700 ~/.ssh
mkdir -m 700 $HOME/.ssh

View file

@ -27,7 +27,7 @@ fi
STRICT_HOSTKEYS_CHECKING="-o StrictHostKeyChecking=no"
if [ "${INPUT_STRICT_HOSTKEYS_CHECKING:-false}" = "true" ]; then
STRICT_HOSTKEYS_CHECKING="-o UserKnownHostsFile=~/.ssh/known_hosts -o StrictHostKeyChecking=yes"
STRICT_HOSTKEYS_CHECKING="-o UserKnownHostsFile=$HOME/.ssh/known_hosts -o StrictHostKeyChecking=yes"
key="$(ssh-keyscan -p "$INPUT_REMOTE_PORT" "$INPUT_REMOTE_HOST" 2>/dev/null | sed '/^#/d')" || key=""
if [ -n "$key" ]; then
@ -38,7 +38,7 @@ if [ "${INPUT_STRICT_HOSTKEYS_CHECKING:-false}" = "true" ]; then
set +x
echo "debug"
cat "~/.ssh/known_hosts"
cat $HOME/.ssh/known_hosts
else
echo "Warning: failed to fetch host key for $INPUT_REMOTE_HOST" >&2
exit 1