From 2d334d3edef023834e6106ed8cac7420f0a6f55d Mon Sep 17 00:00:00 2001 From: Jonas L Date: Tue, 26 Jul 2022 14:17:35 +0200 Subject: [PATCH] ci: website-preview use single comment (#1996) --- .github/workflows/website-preview-command.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/website-preview-command.yml b/.github/workflows/website-preview-command.yml index 6a326bdc5..36038c063 100644 --- a/.github/workflows/website-preview-command.yml +++ b/.github/workflows/website-preview-command.yml @@ -64,13 +64,23 @@ jobs: full_commit_message: "deploy pr-${{ github.event.inputs.pull-request-number }}" keep_files: true + - name: Find deployment comment + uses: peter-evans/find-comment@v2 + id: find-comment + with: + issue-number: ${{ github.event.inputs.pull-request-number }} + comment-author: github-actions[bot] + body-includes: Website preview deployment + - name: Notify deployment succeeded if: ${{ success() }} uses: peter-evans/create-or-update-comment@v2 with: issue-number: ${{ github.event.inputs.pull-request-number }} + comment-id: ${{ steps.find-comment.outputs.comment-id }} + edit-mode: replace body: | - **:rocket: Preview deployment succeeded!** + **:rocket: Website preview deployment succeeded!** Website preview: ${{ env.PREVIEW_URL }}${{ env.PREVIEW_BASE_URL }}pr-${{ github.event.inputs.pull-request-number }}/ New docs preview: ${{ env.PREVIEW_URL }}${{ env.PREVIEW_BASE_URL }}pr-${{ github.event.inputs.pull-request-number }}/docs/next/ @@ -81,8 +91,10 @@ jobs: uses: peter-evans/create-or-update-comment@v2 with: issue-number: ${{ github.event.inputs.pull-request-number }} + comment-id: ${{ steps.find-comment.outputs.comment-id }} + edit-mode: replace body: | - **:boom: Preview deployment failed!** + **:boom: Website preview deployment failed!** Workflow: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}