Skip to content

Commit 532f30d

Browse files
committed
[fix]修复pr时的ci bug
1 parent 8998bfd commit 532f30d

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

.github/workflows/pull.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
name: PullLint
22
on:
3+
pull_request:
4+
types: [opened, synchronize, reopened]
35
pull_request_target:
46
types: [assigned, opened, synchronize, reopened]
57
jobs:
68
# This workflow closes invalid PR
79
close-pr:
810
name: closepr
11+
if: ${{ github.event_name == 'pull_request_target' }}
912
# The type of runner that the job will run on
1013
runs-on: ubuntu-latest
1114
permissions: write-all
@@ -20,22 +23,22 @@ jobs:
2023
comment: "非法PR. 请`fork`后修改自己的仓库, 而不是向主仓库提交更改. 如果您确信您的PR是为了给主仓库新增功能或修复bug, 请更改默认PR标题. **注意**: 如果您再次触发本提示, 则有可能导致账号被封禁."
2124

2225
golangci:
23-
needs: close-pr
24-
if: ${{ !contains(github.event.pull_request.title, '.go') }}
26+
if: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.title, '.go') }}
2527
uses: ./.github/workflows/lib_lint.yml
2628
with:
2729
ref: ${{ github.event.pull_request.head.sha }}
2830
commit_back: false
2931

3032
runmain:
3133
needs: golangci
32-
if: ${{ !contains(github.event.pull_request.title, '.go') }}
34+
if: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.title, '.go') }}
3335
uses: ./.github/workflows/lib_run.yml
3436
with:
3537
ref: ${{ github.event.pull_request.head.sha }}
3638

3739
build:
3840
needs: [runmain]
41+
if: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.title, '.go') }}
3942
uses: ./.github/workflows/lib_build.yml
4043
with:
4144
prefix: "zbp_"

0 commit comments

Comments
 (0)