diff --git a/.github/workflows/link_checker_workflow.yaml b/.github/workflows/link_checker_workflow.yaml index c372a7e2167..54c598be3dc 100644 --- a/.github/workflows/link_checker_workflow.yaml +++ b/.github/workflows/link_checker_workflow.yaml @@ -101,6 +101,16 @@ jobs: # Clean the report (remove redirects) AND append it to the file sed -E '/(Redirect|Redirects per input)/d' lychee-report.md >> full-report.md + + - name: Delete comment on success + if: env.HAS_CHANGES == 'true' && steps.lychee-check.outcome == 'success' && steps.find-comment.outputs.comment-id != '' + run: | + gh api \ + --method DELETE \ + -H "Accept: application/vnd.github+json" \ + /repos/${{ github.repository }}/issues/comments/${{ steps.find-comment.outputs.comment-id }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Create PR Comment if: env.HAS_CHANGES == 'true' && steps.lychee-check.outcome == 'failure'