18
18
push :
19
19
branches :
20
20
- main
21
- pull_request_target :
21
+ pull_request :
22
22
branches :
23
23
- main
24
24
- docs
@@ -38,13 +38,13 @@ jobs:
38
38
- name : Checkout Code
39
39
uses : actions/checkout@v3
40
40
with :
41
- repository : ${{github.event.pull_request.head.repo.full_name}}
42
- ref : ${{github.event.pull_request.head.ref}}
41
+ repository : ${{ github.event.pull_request.head.repo.full_name }}
42
+ ref : ${{ github.event.pull_request.head.ref }}
43
43
submodules : true
44
44
fetch-depth : 0
45
45
46
46
- name : Leave the comment on pull request when started
47
- if : ${{ github.event_name == 'pull_request_target ' }}
47
+ if : ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'alibaba/GraphAr ' }}
48
48
uses : actions-cool/maintain-one-comment@v3
49
49
with :
50
50
token : ${{ secrets.GITHUB_TOKEN }}
@@ -71,15 +71,15 @@ jobs:
71
71
popd
72
72
73
73
- name : Preview using surge
74
- if : ${{ github.event_name == 'pull_request_target ' && github.repository == 'alibaba/GraphAr' }}
74
+ if : ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'alibaba/GraphAr ' && github.repository == 'alibaba/GraphAr' }}
75
75
run : |
76
76
npm install -g surge
77
77
surge ./docs/_build/html \
78
78
alibaba-graphar-build-pr-${{ github.event.number }}.surge.sh \
79
79
--token ${{ secrets.SURGE_TOKEN }}
80
80
81
81
- name : Leave the comment on pull request when succeed
82
- if : ${{ github.event_name == 'pull_request_target ' }}
82
+ if : ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'alibaba/GraphAr ' }}
83
83
uses : actions-cool/maintain-one-comment@v3
84
84
with :
85
85
token : ${{ secrets.GITHUB_TOKEN }}
94
94
body-include : ' <!-- Sticky Pull Request Comment: Surge Preview build -->'
95
95
96
96
- name : Leave the comment on pull request when failed
97
- if : ${{ failure() && github.event_name == 'pull_request_target ' }}
97
+ if : ${{ failure() && github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'alibaba/GraphAr ' }}
98
98
uses : actions-cool/maintain-one-comment@v3
99
99
with :
100
100
token : ${{ secrets.GITHUB_TOKEN }}
0 commit comments