File tree 1 file changed +17
-9
lines changed
1 file changed +17
-9
lines changed Original file line number Diff line number Diff line change 9
9
check-email :
10
10
runs-on : ubuntu-latest
11
11
steps :
12
- - uses : actions/checkout@v3
12
+ - uses : actions/checkout@v4
13
13
- name : check_github_primary_email
14
14
run : |
15
- 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
16
- - uses : actions/checkout@v3
17
- with :
18
- ref : ${{ github.event.pull_request.head.sha }}
19
- - name : check_local_email
20
- run : |
21
- 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
15
+ # 获取最新提交的作者邮箱和提交者邮箱
16
+ log_emails=$(git log --pretty=format:"%ae %ce" -1)
17
+ # 如果邮箱包含 'tdesign@tencent.com',跳过验证
18
+ if [[ ${log_emails} =~ 'tdesign@tencent.com' ]];then
19
+ echo "$log_emails 跳过验证"
20
+ exit 0
21
+ fi
22
+ # 如果邮箱包含 '@tencent.com',校验失败,提示用户更改邮箱
23
+ if [[ ${log_emails} =~ '@tencent.com' ]];then
24
+ echo "默认邮箱 $log_emails 校验非法,可以去 https://github.com/settings/emails 更改"
25
+ exit 2;
26
+ else
27
+ # 否则,校验通过
28
+ echo "邮箱 $log_emails 校验通过";
29
+ fi
22
30
lint :
23
31
runs-on : ubuntu-latest
24
32
steps :
25
- - uses : actions/checkout@v2
33
+ - uses : actions/checkout@v4
26
34
- uses : ./.github/actions/install-dep
27
35
- name : lint 检查
28
36
run : npm run lint
You can’t perform that action at this time.
0 commit comments