Skip to content

Commit 51929ef

Browse files
authored
chore(ci): 钉钉通知时带上组件版本号 (#93)
* chore(ci): 钉钉通知时带上组件版本号
1 parent ce97caa commit 51929ef

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

templates/notify.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ curl -H "Authorization: token $GITHUB_TOKEN" $url > $resp_tmp_file
1717

1818
html_url=$(sed -n 5p $resp_tmp_file | sed 's/\"html_url\"://g' | awk -F '"' '{print $2}')
1919
body=$(grep body < $resp_tmp_file | sed 's/\"body\"://g;s/\"//g')
20+
version=$(echo $html_url | awk -F '/' '{print $NF}')
2021

21-
msg='{"msgtype": "markdown", "markdown": {"title": "{{componentName}}更新", "text": "@所有人\n# [{{componentName}}]('$html_url')\n'$body'"}}'
22+
msg='{"msgtype": "markdown", "markdown": {"title": "{{componentName}}更新", "text": "@所有人\n# [{{componentName}}('$version')]('$html_url')\n'$body'"}}'
2223

2324
curl -X POST https://oapi.dingtalk.com/robot/send\?access_token\=$DINGTALK_ROBOT_TOKEN -H 'Content-Type: application/json' -d "$msg"
2425

0 commit comments

Comments
 (0)