From 827fa5a1719118f6e02440e63e9237f5dff2b119 Mon Sep 17 00:00:00 2001 From: schroda <50052685+schroda@users.noreply.github.com> Date: Wed, 3 Apr 2024 16:30:25 +0200 Subject: [PATCH] [SKIP CI] Feature/improve issue moderator workflow (#701) * [IssueModerator] Improve un-removed "acknowledgment" section detection * [IssueModerator] Check for invalid issue types in title * [IssueModerator] Try to ensure short descriptive title * [IssueModerator] Try to prevent questions in the title --- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- .github/ISSUE_TEMPLATE/feature_request.md | 2 +- .github/workflows/issue_moderator.yml | 22 +++++++++++++++++++++- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index d5e3a2f2..10e68140 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -18,7 +18,7 @@ I acknowledge that: Note that the issue will be automatically closed if you do not fill out the title or requested information. -**DELETE THIS SECTION IF YOU HAVE READ AND ACKNOWLEDGED IT** +**Delete everything up to "## Device information" if you've read and acknowledged this section** --- diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index ad2196f9..a7bd5a40 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -18,7 +18,7 @@ I acknowledge that: Note that the issue will be automatically closed if you do not fill out the title or requested information. -**DELETE THIS SECTION IF YOU HAVE READ AND ACKNOWLEDGED IT** +**Delete everything up to "## What feature should be added to Suwayomi" if you've read and acknowledged this section** --- diff --git a/.github/workflows/issue_moderator.yml b/.github/workflows/issue_moderator.yml index d16fae71..95915c0b 100644 --- a/.github/workflows/issue_moderator.yml +++ b/.github/workflows/issue_moderator.yml @@ -18,6 +18,11 @@ jobs: existing-check-enabled: true auto-close-rules: | [ + { + "type": "title", + "regex": "^(?!(\[(Feature Request|Bug\] )))", + "message": "Invalid title. Must start with either \"[Feature Request]\" or \"[Bug]\"" + }, { "type": "title", "regex": ".*.*", @@ -28,9 +33,24 @@ jobs: "regex": ".*(<|>)+.*", "message": "You did not remove Angle brackets(< and >) from the title" }, + { + "type": "title", + "regex": "^\[(Feature Request|Bug)\](?!.{0,75}$)", + "message": "The title is too long, keep it short and descriptive" + }, + { + "type": "title", + "regex": "^\[(Feature Request|Bug)\](?!.{10,75}$)", + "message": "The title is too short to provide any valuable short description" + }, + { + "type": "title", + "regex": ".*\?.*)", + "message": "The title is not supposed to be a question" + }, { "type": "body", - "regex": ".*DELETE THIS SECTION IF YOU HAVE READ AND ACKNOWLEDGED IT.*", + "regex": "^(?!## (Device information|What feature should be added to Suwayomi\?))", "message": "The acknowledgment section was not removed" }, {