From 4e034f0d05cb7eb71cac6b65ffc2587e210862a7 Mon Sep 17 00:00:00 2001 From: sy-records <52o@qq52o.cn> Date: Mon, 18 Dec 2023 16:05:16 +0800 Subject: [PATCH] Optimize Preview PR CI without duplicate comments --- .github/workflows/pr-preview.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-preview.yml b/.github/workflows/pr-preview.yml index b553ea50c7..11009f47ad 100644 --- a/.github/workflows/pr-preview.yml +++ b/.github/workflows/pr-preview.yml @@ -20,9 +20,16 @@ jobs: SCRIPT_BEFORE: bash /home/thephpfoundation/scripts/pr_created_pre.sh web-php ${{ github.event.number }} SCRIPT_AFTER: bash /home/thephpfoundation/scripts/pr_created.sh web-php ${{ github.event.number }} + - uses: peter-evans/find-comment@v2 + id: fc + with: + issue-number: ${{ github.event.number }} + comment-author: 'github-actions[bot]' + - uses: peter-evans/create-or-update-comment@v3 with: issue-number: ${{ github.event.number }} + comment-id: ${{ steps.fc.outputs.comment-id }} edit-mode: 'replace' body: | - 🚀 Deployed on https://web-php-pr-${{ github.event.number }}.preview.thephp.foundation + 🚀 Commit $(echo ${GITHUB_SHA::8}) Deployed on https://web-php-pr-${{ github.event.number }}.preview.thephp.foundation