Skip to content

Commit c86c072

Browse files
author
levy
committed
Merge branch 'dev'
2 parents d771b7d + 66b6df7 commit c86c072

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

notify.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,15 @@ then
55
exit 1
66
fi
77

8-
url=https://api.github.com/repos/FEMessage/vue-sfc-cli/releases/latest
8+
ORG_NAME=$(echo "$TRAVIS_REPO_SLUG" | cut -d '/' -f 1)
9+
REPO_NAME=$(echo "$TRAVIS_REPO_SLUG" | cut -d '/' -f 2)
10+
11+
git remote add github https://$GITHUB_TOKEN@github.com/$TRAVIS_REPO_SLUG.git > /dev/null 2>&1
12+
git push github HEAD:master --follow-tags
13+
14+
GREN_GITHUB_TOKEN=$GITHUB_TOKEN yarn release
15+
16+
url=https://api.github.com/repos/$TRAVIS_REPO_SLUG/releases/latest
917
resp_tmp_file=resp.tmp
1018

1119
curl -H "Authorization: token $GITHUB_TOKEN" $url > $resp_tmp_file
@@ -14,7 +22,7 @@ html_url=$(sed -n 5p $resp_tmp_file | sed 's/\"html_url\"://g' | awk -F '"' '{pr
1422
body=$(grep body < $resp_tmp_file | sed 's/\"body\"://g;s/\"//g')
1523
version=$(echo $html_url | awk -F '/' '{print $NF}')
1624

17-
msg='{"msgtype": "markdown", "markdown": {"title": "vue-sfc-cli更新", "text": "@所有人\n# [vue-sfc-cli('$version')]('$html_url')\n'$body'"}}'
25+
msg='{"msgtype": "markdown", "markdown": {"title": "'$REPO_NAME'更新", "text": "@所有人\n# ['$REPO_NAME'('$version')]('$html_url')\n'$body'"}}'
1826

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

templates/notify.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ then
55
exit 1
66
fi
77

8-
ORG_NAME=$(cut -d '/' -f 1 <<< "$TRAVIS_REPO_SLUG")
9-
10-
REPO_NAME=$(cut -d '/' -f 2 <<< "$TRAVIS_REPO_SLUG")
8+
ORG_NAME=$(echo "$TRAVIS_REPO_SLUG" | cut -d '/' -f 1)
9+
REPO_NAME=$(echo "$TRAVIS_REPO_SLUG" | cut -d '/' -f 2)
1110

1211
git remote add github https://$GITHUB_TOKEN@github.com/$TRAVIS_REPO_SLUG.git > /dev/null 2>&1
1312
git push github HEAD:master --follow-tags
@@ -23,7 +22,7 @@ html_url=$(sed -n 5p $resp_tmp_file | sed 's/\"html_url\"://g' | awk -F '"' '{pr
2322
body=$(grep body < $resp_tmp_file | sed 's/\"body\"://g;s/\"//g')
2423
version=$(echo $html_url | awk -F '/' '{print $NF}')
2524

26-
msg='{"msgtype": "markdown", "markdown": {"title": "$REPO_NAME更新", "text": "@所有人\n# [$REPO_NAME('$version')]('$html_url')\n'$body'"}}'
25+
msg='{"msgtype": "markdown", "markdown": {"title": "'$REPO_NAME'更新", "text": "@所有人\n# ['$REPO_NAME'('$version')]('$html_url')\n'$body'"}}'
2726

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

0 commit comments

Comments
 (0)