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.