feat: Ensure we're given a JID and a password
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
PapaTutuWawa 2023-08-22 20:26:39 +02:00
parent 989661a1c7
commit 567c0af254

View File

@ -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.