Skip to content

Commit b764b4c

Browse files
committed
try
1 parent dbf1ba8 commit b764b4c

File tree

1 file changed

+8
-15
lines changed

1 file changed

+8
-15
lines changed

.github/workflows/preview-url-report.yml

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ name: Report Preview URLs
22

33
on:
44
pull_request:
5-
types: [opened, synchronize, reopened]
65
branches: ["develop"]
76
paths:
87
- 'docs/**.rst'
@@ -18,40 +17,34 @@ jobs:
1817
pull-requests: write
1918

2019
steps:
21-
- name: Checkout base branch
20+
- name: Checkout repository
2221
uses: actions/checkout@v4
2322
with:
24-
ref: ${{ github.event.pull_request.base.sha }}
2523
fetch-depth: 0
2624

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
3228
3329
- name: Generate comment body
3430
id: generate-comment
3531
run: |
3632
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-
4033
{
4134
echo 'comment_body<<EOF'
42-
echo "$COMMENT_BODY"
35+
./ci_scripts/report_preview_url.sh ${{ github.event.pull_request.number }}
4336
echo EOF
4437
} >> $GITHUB_OUTPUT
4538
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
4841
id: fc
4942
with:
5043
issue-number: ${{ github.event.pull_request.number }}
5144
comment-author: 'github-actions[bot]'
5245
body-includes: '本次 PR 文档预览链接'
5346

54-
- name: Create or update comment
47+
- name: Create or Update Comment
5548
uses: peter-evans/create-or-update-comment@v4
5649
with:
5750
comment-id: ${{ steps.fc.outputs.comment-id }}

0 commit comments

Comments
 (0)