From b532a604f2b79c16b898e96b877a80a16727340e Mon Sep 17 00:00:00 2001 From: zcong1993 Date: Mon, 26 Aug 2019 15:37:16 +0800 Subject: [PATCH] ensure args exists --- entrypoint.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/entrypoint.sh b/entrypoint.sh index 7590f5e..68add03 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,5 +1,17 @@ #!/bin/sh -l +if [ -z "${INPUT_DINGTOKEN}" ] +then + echo "dingToken is required!" + exit 1 +fi + +if [ -z "${INPUT_MESSAGE}" ] +then + echo "message is required!" + exit 1 +fi + url="https://oapi.dingtalk.com/robot/send?access_token=${INPUT_DINGTOKEN}" curl "$url" \