actions-ding/entrypoint.sh
2019-08-29 16:48:20 +08:00

22 lines
353 B
Bash
Executable File

#!/bin/sh -l
if [ -z "${INPUT_DINGTOKEN}" ]
then
echo "dingToken is required!"
exit 1
fi
if [ -z "${INPUT_BODY}" ]
then
echo "body is required!"
exit 1
fi
echo "body: $INPUT_BODY"
url="https://oapi.dingtalk.com/robot/send?access_token=${INPUT_DINGTOKEN}"
curl "$url" \
-H 'Content-Type: application/json' \
-d "${INPUT_BODY}"