From 7acd14cc49af1e2d803c45560feffc4ad787b8b2 Mon Sep 17 00:00:00 2001 From: iBug Date: Thu, 30 Jun 2022 00:56:10 +0800 Subject: [PATCH 1/2] Improve auto-comment message --- .github/PULL_REQUEST_TEMPLATE.md | 3 +-- .github/workflows/bad-pr.yml | 8 ++++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 2c5d045a13f9..3271858f6dae 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -26,6 +26,5 @@ --> diff --git a/.github/workflows/bad-pr.yml b/.github/workflows/bad-pr.yml index ce9de201d2de..e472c767a510 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') || github.event.pull_request.body == ''" + if: "contains(github.event.pull_request.body, 'by deleting this comment block') || github.event.pull_request.body == ''" steps: - uses: actions-ecosystem/action-add-labels@v1 with: @@ -15,4 +15,8 @@ jobs: - 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*." + comment: | + **You have created a Pull Request to the wrong repository.** This is the repository for [Minimal Mistakes][1], the free Jekyll theme. See [GitHub Docs: About pull requests][2] if you need help. + + [1]: https://mmistakes.github.io/minimal-mistakes/ + [2]: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests From 3a377e05074422d06bc22a80ef002f6a2c2d756a Mon Sep 17 00:00:00 2001 From: iBug Date: Tue, 5 Jul 2022 17:44:00 +0800 Subject: [PATCH 2/2] Lock these PRs after closing --- .github/workflows/bad-pr.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/bad-pr.yml b/.github/workflows/bad-pr.yml index e472c767a510..e53e0e30d529 100644 --- a/.github/workflows/bad-pr.yml +++ b/.github/workflows/bad-pr.yml @@ -20,3 +20,8 @@ jobs: [1]: https://mmistakes.github.io/minimal-mistakes/ [2]: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests + - uses: sudo-bot/action-pull-request-lock@v1.0.5 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + number: ${{ github.event.pull_request.number }} + lock-reason: spam