Skip to content

Commit

Permalink
Optimize Preview PR CI without duplicate comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sy-records committed Dec 18, 2023
1 parent 417dc0f commit 4e034f0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/workflows/pr-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 4e034f0

Please sign in to comment.