From 1e3f89781d0a7e6caca45f03336900c9a386c6bf Mon Sep 17 00:00:00 2001 From: Kevin Aleman Date: Tue, 25 May 2021 15:49:14 -0500 Subject: [PATCH 1/5] Check PR Title on every submission --- .github/pr-title-checker-config.json | 10 ++++++++++ .github/workflows/pr-title-checker.yml | 14 ++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 .github/pr-title-checker-config.json create mode 100644 .github/workflows/pr-title-checker.yml diff --git a/.github/pr-title-checker-config.json b/.github/pr-title-checker-config.json new file mode 100644 index 0000000000000..9cbc4961788e3 --- /dev/null +++ b/.github/pr-title-checker-config.json @@ -0,0 +1,10 @@ +{ + "LABEL": { + "name": "Title needs format :)", + "color": "EEEEEE" + }, + "CHECKS": { + "prefixes": ["Bump", "Fix:", "Improve:", "Regression:", "Patch:", "Hotfix:", "[FIX]", "[IMPROVE]", "[REGRESSION]", "[PATCH]", "[HOTFIX]", ["Snyk"]], + "ignoreLabels" : ["[ignore-title]"] + } + } diff --git a/.github/workflows/pr-title-checker.yml b/.github/workflows/pr-title-checker.yml new file mode 100644 index 0000000000000..bff4f7db9ca62 --- /dev/null +++ b/.github/workflows/pr-title-checker.yml @@ -0,0 +1,14 @@ +name: "PR Title Checker" +on: + pull_request: + types: + - opened + - edited + +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: thehanimo/pr-title-checker@v1.2 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 3503624a8f50d2f6a3db08476d4fbc39bbd2e8c8 Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Thu, 27 May 2021 00:13:28 -0300 Subject: [PATCH 2/5] Update .github/pr-title-checker-config.json --- .github/pr-title-checker-config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/pr-title-checker-config.json b/.github/pr-title-checker-config.json index 9cbc4961788e3..95f77fada1a6e 100644 --- a/.github/pr-title-checker-config.json +++ b/.github/pr-title-checker-config.json @@ -4,7 +4,7 @@ "color": "EEEEEE" }, "CHECKS": { - "prefixes": ["Bump", "Fix:", "Improve:", "Regression:", "Patch:", "Hotfix:", "[FIX]", "[IMPROVE]", "[REGRESSION]", "[PATCH]", "[HOTFIX]", ["Snyk"]], + "regexp": "^(((\[(NEW|BREAK|IMPROVE|FIX)\](\[(ENTERPRISE|APPS)\])? )|((Regression|Chore|Bump): )).+|(Release [0-9]+\.[0-9]+.[0-9]+))", "ignoreLabels" : ["[ignore-title]"] } } From 82375edf26146a96b7acb4053e580cbc859672e7 Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Thu, 27 May 2021 00:21:09 -0300 Subject: [PATCH 3/5] Update .github/pr-title-checker-config.json --- .github/pr-title-checker-config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/pr-title-checker-config.json b/.github/pr-title-checker-config.json index 95f77fada1a6e..01604b44ed295 100644 --- a/.github/pr-title-checker-config.json +++ b/.github/pr-title-checker-config.json @@ -4,7 +4,7 @@ "color": "EEEEEE" }, "CHECKS": { - "regexp": "^(((\[(NEW|BREAK|IMPROVE|FIX)\](\[(ENTERPRISE|APPS)\])? )|((Regression|Chore|Bump): )).+|(Release [0-9]+\.[0-9]+.[0-9]+))", + "regexp": "^(((\\[(NEW|BREAK|IMPROVE|FIX)\\](\\[(ENTERPRISE|APPS)\\])? )|((Regression|Chore|Bump): )).+|(Release [0-9]+\\.[0-9]+.[0-9]+))", "ignoreLabels" : ["[ignore-title]"] } } From 0efb5f4716b4ee89302c7dd3b37765a63a69a079 Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Mon, 14 Jun 2021 17:58:52 -0300 Subject: [PATCH 4/5] Fix regex --- .github/pr-title-checker-config.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/pr-title-checker-config.json b/.github/pr-title-checker-config.json index 01604b44ed295..eb1bb148dee86 100644 --- a/.github/pr-title-checker-config.json +++ b/.github/pr-title-checker-config.json @@ -1,10 +1,10 @@ { "LABEL": { - "name": "Title needs format :)", - "color": "EEEEEE" + "name": "Invalid PR Title", + "color": "B60205" }, "CHECKS": { - "regexp": "^(((\\[(NEW|BREAK|IMPROVE|FIX)\\](\\[(ENTERPRISE|APPS)\\])? )|((Regression|Chore|Bump): )).+|(Release [0-9]+\\.[0-9]+.[0-9]+))", + "regexp": "^(?:(?:\\[(NEW|BREAK|IMPROVE|FIX)\\](\\[(ENTERPRISE|APPS)\\])?|(?:Regression|Chore|Bump):) .+|Release [0-9]+\\.[0-9]+\\.[0-9]+)", "ignoreLabels" : ["[ignore-title]"] } } From cf703dc9074708c4da20311676bfe7257f994b18 Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Mon, 14 Jun 2021 18:05:43 -0300 Subject: [PATCH 5/5] better syntax --- .github/workflows/pr-title-checker.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/pr-title-checker.yml b/.github/workflows/pr-title-checker.yml index bff4f7db9ca62..4cd045587a3e3 100644 --- a/.github/workflows/pr-title-checker.yml +++ b/.github/workflows/pr-title-checker.yml @@ -1,9 +1,7 @@ name: "PR Title Checker" on: pull_request: - types: - - opened - - edited + types: [opened, edited] jobs: check: