Skip to content

Commit ff1af96

Browse files
committed
fix(scripts): use $HOME variable for known_hosts path
• Replaced hardcoded ~/.ssh/known_hosts with ${HOME}/.ssh/known_hosts in check.sh and post_check.sh. • Ensures compatibility with environments where $HOME may differ from the default user directory. • Maintains clarity and consistency across script file path handling.
1 parent e0f59f8 commit ff1af96

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

check.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env sh
22

3-
if [ ! -s ~/.ssh/known_hosts ]; then
3+
if [ ! -s "${HOME}/.ssh/known_hosts" ]; then
44
echo "::error file=$(basename "$0"),line=${LINENO},endLine=${LINENO},title=Assertion Error::\
55
~/.ssh/known_hosts is missing or empty."
66
exit 1

post_check.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env sh
22

3-
if [ -s ~/.ssh/known_hosts ]; then
3+
if [ -s "${HOME}/.ssh/known_hosts" ]; then
44
echo "::error file=$(basename "$0"),line=${LINENO},endLine=${LINENO},title=Assertion Error::\
55
~/.ssh/known_hosts file should not exist after the job."
66
exit 1

0 commit comments

Comments
 (0)