From 37528a4a3626863ab3e3171b38d70a07860ebc69 Mon Sep 17 00:00:00 2001 From: William Harrison <87287585+wdhdev@users.noreply.github.com> Date: Wed, 19 Aug 2026 12:07:00 +0800 Subject: [PATCH] Update pr-template.yml --- .github/workflows/pr-template.yml | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-template.yml b/.github/workflows/pr-template.yml index 8f891d97a6..349ac60863 100644 --- a/.github/workflows/pr-template.yml +++ b/.github/workflows/pr-template.yml @@ -112,13 +112,14 @@ jobs: }); } - - name: Remove incomplete label + - name: Remove incomplete label and comment if: steps.validate.outcome == 'success' uses: actions/github-script@v8 with: github-token: ${{ secrets.BOT }} script: | const label = "reason: incomplete pr"; + const marker = ""; try { await github.rest.issues.removeLabel({ @@ -133,6 +134,28 @@ jobs: } } + const comments = await github.paginate( + github.rest.issues.listComments, + { + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number + } + ); + + for (const comment of comments) { + if ( + comment.user?.login === "is-a-dev-bot" && + comment.body?.includes(marker) + ) { + await github.rest.issues.deleteComment({ + owner: context.repo.owner, + repo: context.repo.repo, + comment_id: comment.id + }); + } + } + - name: Fail if PR template is incomplete if: steps.validate.outcome == 'failure' run: |