From 6707edc71213cb45ce72ffdb6e904be40452bac2 Mon Sep 17 00:00:00 2001 From: Morgan Pretty Date: Wed, 3 Apr 2024 16:08:26 +1100 Subject: [PATCH] Added error if the clone key isn't set --- .drone.jsonnet | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.drone.jsonnet b/.drone.jsonnet index 80f0ff5d0..3f28d3261 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -16,6 +16,12 @@ local custom_clone = { name: 'Clone', environment: { CLONE_KEY: { from_secret: 'CLONE_KEY' } }, commands: [ + ||| + if [ -z "$CLONE_KEY" ]; then + echo -e "\n\n\n\e[31;1mUnable to checkout repo: CLONE_KEY not set\e[0m" + exit 1 + fi + |||, 'eval "$(ssh-agent -s)"', 'echo "${CLONE_KEY}" | ssh-add -', 'mkdir -p ~/.ssh && touch ~/.ssh/config && touch ~/.ssh/known_hosts && chmod -R 400 ~/.ssh',