Skip to content

Commit a3568a1

Browse files
authored
fix: update existing comment (#253)
1 parent 50d9e79 commit a3568a1

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

.github/workflows/rst-preview-comment.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,20 @@ jobs:
3535
# Write to file to preserve formatting
3636
echo "$COMMENT" > /tmp/comment-body.md
3737
38-
- name: Post or update comment
39-
uses: peter-evans/create-or-update-comment@v4
38+
# Find existing comment from this bot with the hidden marker
39+
- name: Find existing RST preview comment
40+
id: fc
41+
uses: peter-evans/find-comment@v3
4042
with:
4143
issue-number: ${{ github.event.issue.number }}
42-
body-path: /tmp/comment-body.md
4344
comment-author: 'github-actions[bot]'
44-
# Use a hidden marker to identify and update the same comment
4545
body-includes: '<!-- rst-preview-comment -->'
46+
47+
# Create a new comment or update the existing one
48+
- name: Create or update RST preview comment
49+
uses: peter-evans/create-or-update-comment@v5
50+
with:
51+
issue-number: ${{ github.event.issue.number }}
52+
comment-id: ${{ steps.fc.outputs.comment-id }}
53+
body-path: /tmp/comment-body.md
4654
edit-mode: replace

0 commit comments

Comments
 (0)