Skip to content

Commit fad31a4

Browse files
committed
fix(post_action): ensure consistent variable definition for known hosts
• Defined SSH_KNOWN_HOSTS_FILE explicitly in post_action.sh for clarity and consistency. • Maintained existing temporary file logic for truncating the last line from the known_hosts file. • Improved readability by ensuring all required variables are explicitly initialized within the script.
1 parent b7b542a commit fad31a4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

post_action.sh

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

3+
SSH_KNOWN_HOSTS_FILE="${HOME}/.ssh/known_hosts"
34
TEMP_FILE="/tmp/718f4157-5493-43b2-837b-3ccb27f78e7b"
45

56
head --lines=-1 "${SSH_KNOWN_HOSTS_FILE}" > "${TEMP_FILE}"
@@ -9,4 +10,5 @@ rm -rf "${TEMP_FILE}"
910
echo "::notice file=$(basename "$0"),line=${LINENO},endLine=${LINENO},title=Notice::\
1011
${SSH_KNOWN_HOSTS_FILE} has been cleaned."
1112

13+
unset SSH_KNOWN_HOSTS_FILE
1214
unset TEMP_FILE

0 commit comments

Comments
 (0)