Update pr-template.yml

This commit is contained in:
William Harrison authored and GitHub committed 2026-08-19 12:07:00 +08:00
1 parent aefe6a8783
commit 37528a4a36
1 file changed
+24 -1
+24 -1
View File
@@ -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 = "<!-- is-a-dev-bot: incomplete-pr-template -->";
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: |