Skip to content

Commit

Permalink
chore: update publish config
Browse files Browse the repository at this point in the history
  • Loading branch information
NicoKam committed Sep 4, 2023
1 parent c36f719 commit 723bac3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
1 change: 0 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,4 @@ jobs:
run: |
./emit-log.sh
env:
TEST_TOKEN: test-token
DING_TOKEN: ${{secrets.DING_TOKEN}}
9 changes: 4 additions & 5 deletions emit-log.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
#!/usr/bin/env bash


# 取出 log.txt 的文件内容
log=$(cat log.txt|grep 'New tag:')

# 如果 log.txt 为空
if [ -z "$log" ]; then
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流水线结束,没有新的模块发布"}}'
-d '{"msgtype": "markdown","markdown": {"title":"orca-fe 发布通知","text":"### @orca-fe/vite-plugins\n\n流水线结束,没有新的模块发布"}}'
exit 0
fi

# 如果 log.txt 不为空,则将 log 作为消息发出去,需要将 log 的换行符替换为 \n
log=${log//$'\n'/\\n}
# 如果 log.txt 不为空,则将 log 作为消息发出去,需要将 log 的换行符替换为 \n\n
log=$(echo "$log"|sed 's/\n/\\n\\n/g')
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"'"}}'
-d '{"msgtype": "markdown","markdown": {"title":"orca-fe 发布通知","text":"### @orca-fe/vite-plugins\n\n流水线结束,以下模块已发布:\n\n'"$log"'"}}'

0 comments on commit 723bac3

Please sign in to comment.