mirror of
https://github.com/tiennm99/is-a-dev.git
synced 2026-10-11 03:13:35 +00:00
Update pr-template.yml
This commit is contained in:
1 parent
aefe6a8783
commit
37528a4a36
1 file changed
+24
-1
@@ -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: |
|
||||
|
||||
Reference in new issue
Block a user