Skip to content

Commit

Permalink
Improve PR close auto-comment message (mmistakes#3713)
Browse files Browse the repository at this point in the history
* Improve auto-comment message

* Lock these PRs after closing
  • Loading branch information
iBug authored and njjc committed Dec 20, 2023
1 parent 4835bff commit 4f1f7b1
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!--
Thanks for creating a Pull Request! Before you submit, please make sure
you've done the following:
- Read the contributing document at https://github.com/mmistakes/minimal-mistakes#contributing
-->

<!--
Choose one of the following by uncommenting it:
-->

<!-- This is a bug fix. -->
<!-- This is an enhancement or feature. -->
<!-- This is a documentation change. -->

## Summary

<!--
Provide a description of what your pull request changes.
-->

## Context

<!--
Is this related to any GitHub issue(s)?
-->

<!--
Please confirm that you want to submit this Pull Request to Minimal Mistakes, the free Jekyll theme by Michael Rose, by deleting this comment block.
-->
27 changes: 27 additions & 0 deletions .github/workflows/bad-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
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, 'by deleting this comment block') || 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: |
**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
- 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

0 comments on commit 4f1f7b1

Please sign in to comment.