From 9f9cee5c9d98c65608bd394d7491064dc9e2c725 Mon Sep 17 00:00:00 2001 From: Andy Augustin Date: Wed, 13 Mar 2024 22:39:54 +0100 Subject: [PATCH] fix: :bug: issue with known hosts Signed-off-by: Andy Augustin --- src/entrypoint.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/entrypoint.sh b/src/entrypoint.sh index a16b79de..d0f77f38 100755 --- a/src/entrypoint.sh +++ b/src/entrypoint.sh @@ -22,6 +22,11 @@ if [[ -z "${SOURCE_REPO_PATH}" ]]; then exit 1 fi +if [[ -z "${HOME}" ]]; then + err "Missing env variable HOME."; + exit 1 +fi + ############################################ # Variables ############################################ @@ -147,7 +152,8 @@ function git_init() { if [[ "${IS_NOT_SOURCE_GITHUB}" == 'true' ]]; then info "the source repository is not located within GitHub." - ssh-keyscan -t rsa "${source_repo_hostname}" >> /root/.ssh/known_hosts + mkdir -p "${HOME}"/.ssh + ssh-keyscan -t rsa "${source_repo_hostname}" >> "${HOME}"/.ssh/known_hosts else info "the source repository is located within GitHub." gh auth setup-git --hostname "${source_repo_hostname}"