actions-ding/entrypoint.sh

22 lines
353 B
Bash
Raw Normal View History

2019-08-26 14:36:42 +08:00
#!/bin/sh -l
2019-08-26 15:37:16 +08:00
if [ -z "${INPUT_DINGTOKEN}" ]
then
echo "dingToken is required!"
exit 1
fi
2019-08-29 16:48:20 +08:00
if [ -z "${INPUT_BODY}" ]
2019-08-26 15:37:16 +08:00
then
2019-08-29 16:48:20 +08:00
echo "body is required!"
2019-08-26 15:37:16 +08:00
exit 1
fi
2019-08-29 16:48:20 +08:00
echo "body: $INPUT_BODY"
2019-08-26 15:24:49 +08:00
2019-08-29 16:48:20 +08:00
url="https://oapi.dingtalk.com/robot/send?access_token=${INPUT_DINGTOKEN}"
2019-08-27 17:37:45 +08:00
2019-08-26 15:24:49 +08:00
curl "$url" \
-H 'Content-Type: application/json' \
2019-08-29 16:48:20 +08:00
-d "${INPUT_BODY}"