ci: website-preview use single comment (#1996)

This commit is contained in:
Jonas L 2022-07-26 14:17:35 +02:00 committed by GitHub
parent 951dc68394
commit 2d334d3ede
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 2 deletions

View File

@ -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 }}