Skip to content

Commit ae8b4b6

Browse files
committed
fix: update existing comment whenever possible
1 parent 756ecee commit ae8b4b6

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

.github/workflows/terraform-plan.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,19 @@ jobs:
6060
- name: Create tf-summarize markdown file
6161
run: tf-summarize -md tfplan >> tf-summary.md
6262

63-
- name: Create PR comment with course-grained plan summary
63+
- name: Check for existing comment
64+
uses: peter-evans/find-comment@b30e6a3c0ed37e7c023ccd3f1db5c6c0b0c23aad # v4.0.0
65+
id: fc
66+
with:
67+
issue-number: ${{ github.event.pull_request.number }}
68+
comment-author: "github-actions[bot]"
69+
body-includes: CHANGE
70+
direction: last
71+
72+
- name: Create or update PR comment with course-grained plan summary
6473
uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0
6574
with:
75+
comment-id: ${{ steps.fc.outputs.comment-id }}
6676
issue-number: ${{ github.event.number }}
6777
body-path: "./terraform/tf-summary.md"
78+
edit-mode: replace

0 commit comments

Comments
 (0)