From 7a4650d6ec5fe4cfa8f4b0f05f7f21083c603bd6 Mon Sep 17 00:00:00 2001 From: Nikolay Vitkov <34244704+Lightning00Blade@users.noreply.github.com> Date: Thu, 19 Jan 2023 14:06:37 +0100 Subject: [PATCH] chore: Upsert comment (#9546) When analyzer reruns we want it to update the comment - this will reduce the number of comments overall. --- .github/workflows/issue-analyzer.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/issue-analyzer.yml b/.github/workflows/issue-analyzer.yml index fae9c3b1917..66b62eeffbd 100644 --- a/.github/workflows/issue-analyzer.yml +++ b/.github/workflows/issue-analyzer.yml @@ -140,9 +140,16 @@ jobs: repo: context.repo.repo, labels: ["invalid"] }) - - name: Add comment + - name: Find Comment Id + uses: peter-evans/find-comment@v2 + id: find-comment-id + with: + issue-number: ${{ github.event.issue.number }} + comment-author: 'github-actions[bot]' + - name: Upsert comment uses: peter-evans/create-or-update-comment@v2 with: + comment-id: ${{ steps.find-comment-id.outputs.comment-id }} issue-number: ${{ github.event.issue.number }} body: ${{ needs.analyze-issue.outputs.errorMessage }} @@ -164,9 +171,16 @@ jobs: repo: context.repo.repo, labels: ["not-reproducible", "needs-feedback"] }) - - name: Add comment + - name: Find Comment Id + uses: peter-evans/find-comment@v2 + id: find-comment-id + with: + issue-number: ${{ github.event.issue.number }} + comment-author: 'github-actions[bot]' + - name: Upsert comment uses: peter-evans/create-or-update-comment@v2 with: + comment-id: ${{ steps.find-comment-id.outputs.comment-id }} issue-number: ${{ github.event.issue.number }} body: | This issue was not reproducible. Please check that your example runs locally and the following: