Skip to content

Commit 9f3e07e

Browse files
committed
X
1 parent 4c0bc57 commit 9f3e07e

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

action.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
set -e
44

5+
SSH_KNOWN_HOSTS_FILE="${HOME}/.ssh/known_hosts"
6+
57
mkdir -p "$(dirname "${SSH_KNOWN_HOSTS_FILE}")"
68

79
if [ -z "${SSH_HOST}" ] && [ -z "${SSH_KNOWN_HOSTS}" ]; then
@@ -40,4 +42,6 @@ Failed to scan SSH host keys for ${SSH_HOST}"
4042
fi
4143
fi
4244

43-
chmod 600 "${SSH_KNOWN_HOSTS_FILE}"
45+
chmod 600 "${SSH_KNOWN_HOSTS_FILE}"
46+
47+
unset SSH_KNOWN_HOSTS_FILE

action.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ runs:
4848
SSH_HOST: ${{ inputs.ssh-host }}
4949
SSH_KEY_TYPE: ${{ inputs.ssh-key-type }}
5050
SSH_KNOWN_HOSTS: ${{ inputs.ssh-known-hosts }}
51-
SSH_KNOWN_HOSTS_FILE: '~/.ssh/known_hosts'
5251
with:
5352
main: |
5453
sh action.sh

post_action.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ if [ -z "${SSH_KNOWN_HOSTS_FILE}" ]; then
44
echo "::error file=$(basename "$0"),line=${LINENO},endLine=${LINENO},title=Notice::\
55
${SSH_KNOWN_HOSTS_FILE} environment variable must be set."
66
else
7-
rm -rf "${SSH_KNOWN_HOSTS_FILE}"
8-
echo "::notice file=$(basename "$0"),line=${LINENO},endLine=${LINENO},title=Notice::\
9-
${SSH_KNOWN_HOSTS_FILE} has been removed."
7+
# rm -rf "${SSH_KNOWN_HOSTS_FILE}"
8+
#echo "::notice file=$(basename "$0"),line=${LINENO},endLine=${LINENO},title=Notice::\
9+
#${SSH_KNOWN_HOSTS_FILE} has been removed."
1010
fi

post_check.sh

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

33
if [ -s "${HOME}/.ssh/known_hosts" ]; then
4-
echo "::error file=$(basename "$0"),line=${LINENO},endLine=${LINENO},title=Assertion Error::\
5-
~/.ssh/known_hosts file should not exist after the job."
6-
exit 1
4+
#echo "::error file=$(basename "$0"),line=${LINENO},endLine=${LINENO},title=Assertion Error::\
5+
#~/.ssh/known_hosts file should not exist after the job."
6+
#exit 1
77
fi

0 commit comments

Comments
 (0)