Skip to content

Commit

Permalink
fix(ci): check for existing preview comment first
Browse files Browse the repository at this point in the history
we don't need a new comment every time a commit is made,
only the first time
  • Loading branch information
thekaveman committed Feb 24, 2024
1 parent d198d54 commit f6fa110
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,17 @@ jobs:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_PREVIEW_APP_SITE_ID }}

- name: Find existing comment
uses: peter-evans/find-comment@v3
id: find-comment
with:
issue-number: ${{ github.event.number }}
comment-author: "github-actions[bot]"
body-includes: "Preview url: https://"

- name: Add Netlify link PR comment
uses: actions/github-script@v7
if: steps.find-comment.outputs.comment-id == ''
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
Expand Down

0 comments on commit f6fa110

Please sign in to comment.