From abead4ece095f343ca4374be2386933132ae68c8 Mon Sep 17 00:00:00 2001 From: iBug Date: Tue, 28 Dec 2021 18:04:28 +0800 Subject: [PATCH 1/3] Try auto-closing bad PRs --- .github/PULL_REQUEST_TEMPLATE.md | 7 ++++++- .github/workflows/bad-pr.yml | 15 +++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/bad-pr.yml diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index df3d98d9c034..2c5d045a13f9 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -23,4 +23,9 @@ \ No newline at end of file +--> + + diff --git a/.github/workflows/bad-pr.yml b/.github/workflows/bad-pr.yml new file mode 100644 index 000000000000..8594a47f6ae7 --- /dev/null +++ b/.github/workflows/bad-pr.yml @@ -0,0 +1,15 @@ +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')" + steps: + - 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*." From a866b21ab04340e53f2d58dc601f7b3ffa9303c1 Mon Sep 17 00:00:00 2001 From: iBug Date: Tue, 28 Dec 2021 18:52:01 +0800 Subject: [PATCH 2/3] Include empty PR body as well --- .github/workflows/bad-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bad-pr.yml b/.github/workflows/bad-pr.yml index 8594a47f6ae7..47bd55d890e5 100644 --- a/.github/workflows/bad-pr.yml +++ b/.github/workflows/bad-pr.yml @@ -7,7 +7,7 @@ on: jobs: close-pr: runs-on: ubuntu-latest - if: "contains(github.event.pull_request.body, 'CHECK_PR_DID_NOT_CONFIRM')" + if: "contains(github.event.pull_request.body, 'CHECK_PR_DID_NOT_CONFIRM') || github.event.pull_request.body == ''" steps: - uses: superbrothers/close-pull-request@v3 with: From cd16dd4199fbc00ba17829ee6a6285ecebeafa02 Mon Sep 17 00:00:00 2001 From: iBug Date: Sat, 8 Jan 2022 15:08:05 +0800 Subject: [PATCH 3/3] Add "Type: Invalid" label as well --- .github/workflows/bad-pr.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/bad-pr.yml b/.github/workflows/bad-pr.yml index 47bd55d890e5..ce9de201d2de 100644 --- a/.github/workflows/bad-pr.yml +++ b/.github/workflows/bad-pr.yml @@ -9,6 +9,9 @@ jobs: 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.