@@ -2,7 +2,6 @@ name: Report Preview URLs
2
2
3
3
on :
4
4
pull_request :
5
- types : [opened, synchronize, reopened]
6
5
branches : ["develop"]
7
6
paths :
8
7
- ' docs/**.rst'
@@ -18,40 +17,34 @@ jobs:
18
17
pull-requests : write
19
18
20
19
steps :
21
- - name : Checkout base branch
20
+ - name : Checkout repository
22
21
uses : actions/checkout@v4
23
22
with :
24
- ref : ${{ github.event.pull_request.base.sha }}
25
23
fetch-depth : 0
26
24
27
- - name : Checkout PR head branch
28
- uses : actions/checkout@v4
29
- with :
30
- ref : ${{ github.event.pull_request.head.sha }}
31
- path : ' pr_head'
25
+ - name : Fetch base branch
26
+ run : |
27
+ git fetch origin develop:develop
32
28
33
29
- name : Generate comment body
34
30
id : generate-comment
35
31
run : |
36
32
chmod +x ci_scripts/report_preview_url.sh
37
-
38
- COMMENT_BODY=$(cd pr_head && ./ci_scripts/report_preview_url.sh ${{ github.event.pull_request.number }})
39
-
40
33
{
41
34
echo 'comment_body<<EOF'
42
- echo "$COMMENT_BODY"
35
+ ./ci_scripts/report_preview_url.sh ${{ github.event.pull_request.number }}
43
36
echo EOF
44
37
} >> $GITHUB_OUTPUT
45
38
46
- - name : Find previous comment
47
- uses : peter-evans/find-comment@v3
39
+ - name : Post or Update Comment
40
+ uses : peter-evans/find-comment@v4
48
41
id : fc
49
42
with :
50
43
issue-number : ${{ github.event.pull_request.number }}
51
44
comment-author : ' github-actions[bot]'
52
45
body-includes : ' 本次 PR 文档预览链接'
53
46
54
- - name : Create or update comment
47
+ - name : Create or Update Comment
55
48
uses : peter-evans/create-or-update-comment@v4
56
49
with :
57
50
comment-id : ${{ steps.fc.outputs.comment-id }}
0 commit comments