Skip to content

Commit

Permalink
ci(test-build): update check mail (#579)
Browse files Browse the repository at this point in the history
* ci(test-build): update check mail

* chore: update
  • Loading branch information
liweijie0812 authored Jan 14, 2025
1 parent c4d4260 commit dca67df
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions .github/workflows/test-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,33 @@ jobs:
- uses: actions/checkout@v4
- name: check_github_primary_email
run: |
log_emails=$(git log --pretty=format:"%ae %ce" -1) && if [[ ${log_emails} =~ '@tencent.com' ]];then echo "默认邮箱 $log_emails 校验非法,可以去 https://github.com/settings/emails 更改" && exit 2;else echo "邮箱 $log_emails 校验通过";fi
log_emails=$(git log --pretty=format:"%ae %ce" -1)
if [[ ${log_emails} == '[email protected]' ]];then
echo "$log_emails 跳过验证"
exit 0
fi
if [[ ${log_emails} =~ '@tencent.com' ]];then
echo "默认邮箱 $log_emails 校验非法,可以去 https://github.com/settings/emails 更改"
exit 2;
else
echo "邮箱 $log_emails 校验通过";
fi
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: check_local_email
run: |
log_emails=$(git log --pretty=format:"%ae %ce" -1) && if [[ ${log_emails} =~ '@tencent.com' ]];then echo "本地提交邮箱 $log_emails 校验非法,需要本地更改重新提交" && exit 2;else echo "邮箱 $log_emails 校验通过";fi
log_emails=$(git log --pretty=format:"%ae %ce" -1)
if [[ ${log_emails} == '[email protected]' ]];then
echo "$log_emails 跳过验证"
exit 0
fi
if [[ ${log_emails} =~ '@tencent.com' ]];then
echo "本地提交邮箱 $log_emails 校验非法,需要本地更改重新提交"
exit 2;
else
echo "邮箱 $log_emails 校验通过";
fi
test:
# needs: check
Expand Down

0 comments on commit dca67df

Please sign in to comment.