Automatically close invalid PRs using GitHub Actions (#3313)

* Try auto-closing bad PRs

* Include empty PR body as well

* Add "Type: Invalid" label as well
This commit is contained in:
iBug 2022-01-10 20:59:04 +08:00 committed by GitHub
parent 9539e3bd84
commit ad1e06633c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 1 deletions

View file

@ -23,4 +23,9 @@
<!--
Is this related to any GitHub issue(s)?
-->
-->
<!--
Please delete this comment if you confirm that you want to submit this Pull Request.
CHECK_PR_DID_NOT_CONFIRM
-->

18
.github/workflows/bad-pr.yml vendored Normal file
View file

@ -0,0 +1,18 @@
name: Cleanup bad PR
on:
pull_request_target:
types: [opened, reopened]
jobs:
close-pr:
runs-on: ubuntu-latest
if: "contains(github.event.pull_request.body, 'CHECK_PR_DID_NOT_CONFIRM') || github.event.pull_request.body == ''"
steps:
- uses: actions-ecosystem/action-add-labels@v1
with:
labels: 'Type: Invalid'
- uses: superbrothers/close-pull-request@v3
with:
# Optional. Post an issue comment just before closing a pull request.
comment: "This PR is not valid for inclusion. Please check again if you're submitting improvements for *the theme*."