Trust resolved deploy host addresses
All checks were successful
Publish Hugo Deployment Image / publish (push) Successful in 30s

This commit is contained in:
Neil Borromeo 2026-04-25 22:05:30 +08:00
commit 7186257987

View file

@ -84,7 +84,13 @@ jobs:
if [[ -n "${DEPLOY_KNOWN_HOSTS:-}" ]]; then
printf '%s\n' "$DEPLOY_KNOWN_HOSTS" > "$HOME/.ssh/known_hosts"
else
ssh-keyscan -H -p "${DEPLOY_SSH_PORT:-22}" "${DEPLOY_SSH_HOST}" > "$HOME/.ssh/known_hosts"
{
ssh-keyscan -H -p "${DEPLOY_SSH_PORT:-22}" "${DEPLOY_SSH_HOST}"
getent ahosts "${DEPLOY_SSH_HOST}" \
| awk '{ print $1 }' \
| sort -u \
| xargs -r -n1 ssh-keyscan -H -p "${DEPLOY_SSH_PORT:-22}"
} > "$HOME/.ssh/known_hosts"
fi
chmod 0600 "$HOME/.ssh/known_hosts"