Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
wang.kangning committed Sep 4, 2023
1 parent 6c6f17c commit 764e66a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions emit-log.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# 取出 log.txt 的文件内容
log=$(cat log.txt|grep 'New tag:')

echo $log

# 如果 log.txt 为空
if [ -z "$log" ]; then
curl 'https://oapi.dingtalk.com/robot/send?access_token=${DING_TOKEN}' \
Expand All @@ -13,6 +15,8 @@ fi

# 如果 log.txt 不为空,则将 log 作为消息发出去,需要将 log 的换行符替换为 \n
log=${log//$'\n'/\\n}
echo $log
echo $DING_TOKEN
curl 'https://oapi.dingtalk.com/robot/send?access_token=${DING_TOKEN}' \
-H 'Content-Type: application/json' \
-d '{"msgtype": "markdown","markdown": {"title":"orca-fe发布通知","text":"### @orca-fe/vite-plugins\n流水线结束,以下模块已发布:\n'"$log"'"}}'
Expand Down

0 comments on commit 764e66a

Please sign in to comment.