From 567c0af254460cba6894aa033920eaaf307e76b1 Mon Sep 17 00:00:00 2001 From: "Alexander \"PapaTutuWawa" Date: Tue, 22 Aug 2023 20:26:39 +0200 Subject: [PATCH] feat: Ensure we're given a JID and a password --- entrypoint.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/entrypoint.sh b/entrypoint.sh index df252e6..1da8b9c 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -30,6 +30,18 @@ if [[ -n "${PLUGIN_XMPP_IS_MUC}" ]]; then BOT_ALIAS=(-a "${PLUGIN_XMPP_ALIAS:-"Woodpecker CI"}") fi +# Sanity checks +CANCEL="" +if [[ -z "${XMPP_JID}" ]]; then + echo "Error: No JID specified using XMPP_JID" + CANCEL="y" +fi +if [[ -z "${XMPP_PASSWORD}" ]]; then + echo "Error: No password specified using XMPP_PASSWORD" + CANCEL="y" +fi +[[ -n "${CANCEL}" ]] && exit 1 + # "Post" the message # Disable SC2086 (double quote to prevent word splitting) and SC2068 (double quote array expansion to prevent word splitting) # because we DO want word splitting here.