Skip to content

Commit

Permalink
fix: 🐛 issue with known hosts
Browse files Browse the repository at this point in the history
Signed-off-by: Andy Augustin <dev@andreas-augustin.org>
  • Loading branch information
AndreasAugustin committed Mar 13, 2024
1 parent 2955b3c commit 9f9cee5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
############################################
Expand Down Expand Up @@ -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}"
Expand Down

0 comments on commit 9f9cee5

Please sign in to comment.