Skip to content

Commit ad1e066

Browse files
authoredJan 10, 2022
Automatically close invalid PRs using GitHub Actions (mmistakes#3313)
* Try auto-closing bad PRs * Include empty PR body as well * Add "Type: Invalid" label as well
1 parent 9539e3b commit ad1e066

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed
 

‎.github/PULL_REQUEST_TEMPLATE.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,9 @@
2323

2424
<!--
2525
Is this related to any GitHub issue(s)?
26-
-->
26+
-->
27+
28+
<!--
29+
Please delete this comment if you confirm that you want to submit this Pull Request.
30+
CHECK_PR_DID_NOT_CONFIRM
31+
-->

‎.github/workflows/bad-pr.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Cleanup bad PR
2+
3+
on:
4+
pull_request_target:
5+
types: [opened, reopened]
6+
7+
jobs:
8+
close-pr:
9+
runs-on: ubuntu-latest
10+
if: "contains(github.event.pull_request.body, 'CHECK_PR_DID_NOT_CONFIRM') || github.event.pull_request.body == ''"
11+
steps:
12+
- uses: actions-ecosystem/action-add-labels@v1
13+
with:
14+
labels: 'Type: Invalid'
15+
- uses: superbrothers/close-pull-request@v3
16+
with:
17+
# Optional. Post an issue comment just before closing a pull request.
18+
comment: "This PR is not valid for inclusion. Please check again if you're submitting improvements for *the theme*."

0 commit comments

Comments
 (0)
Please sign in to comment.