diff --git a/action.sh b/action.sh index 384dd62..01abc17 100755 --- a/action.sh +++ b/action.sh @@ -6,7 +6,10 @@ SSH_KEY_FILE=/tmp/gitea-pages-ssh-key-$(date +%s) echo "${INPUT_SSH_KEY}" >> "${SSH_KEY_FILE}" chmod 600 "${SSH_KEY_FILE}" -cat "${SSH_KEY_FILE}" +if [ ! -s "${SSH_KEY_FILE}" ]; then + echo "Missing ssh key, aborting deploy." + exit 1 +fi # set up ssh remote key echo "${INPUT_HOST} ${INPUT_HOST_KEY}" >> ~/.ssh/known_hosts @@ -14,6 +17,7 @@ echo "${INPUT_HOST} ${INPUT_HOST_KEY}" >> ~/.ssh/known_hosts # check if directory present if [ ! -d "${INPUT_DIRECTORY}" ]; then echo "Directory ${INPUT_DIRECTORY} does not exist, aborting deploy." + exit 1 fi # optionally: create index