From afb90c95cd2542a7b6ad007b89145b819d4d7020 Mon Sep 17 00:00:00 2001 From: EttyKitty <20323032+EttyKitty@users.noreply.github.com> Date: Sat, 28 Dec 2024 02:00:32 +0300 Subject: [PATCH 1/5] Create pr-title-checker.yml --- .github/workflows/pr-title-checker.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/workflows/pr-title-checker.yml diff --git a/.github/workflows/pr-title-checker.yml b/.github/workflows/pr-title-checker.yml new file mode 100644 index 000000000..c1b0e7ca5 --- /dev/null +++ b/.github/workflows/pr-title-checker.yml @@ -0,0 +1,16 @@ +name: "PR Title Checker" +on: + pull_request_target: + types: + - opened + - edited + +jobs: + check: + name: Validate PR Title + runs-on: ubuntu-latest + steps: + - uses: thehanimo/pr-title-checker@v1.4.3 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + pass_on_octokit_error: false From ff3ab51903fdc445e0ddd69c4fdea8086d4af55d Mon Sep 17 00:00:00 2001 From: EttyKitty <20323032+EttyKitty@users.noreply.github.com> Date: Sat, 28 Dec 2024 02:11:48 +0300 Subject: [PATCH 2/5] Create pr-title-checker-config.json --- .github/pr-title-checker-config.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .github/pr-title-checker-config.json diff --git a/.github/pr-title-checker-config.json b/.github/pr-title-checker-config.json new file mode 100644 index 000000000..3cedbc8ed --- /dev/null +++ b/.github/pr-title-checker-config.json @@ -0,0 +1,12 @@ +{ + "LABEL": { + "name": "", + "color": "EEEEEE" + }, + "CHECKS": { + "regexp": "(feat|fix|ci|chore|docs|test|refactor|revert)(\\([^\\)]+\\))?\\!?: .{1,}$|(?:Bump .+)$|^Release [0-9]+\\.[0-9]+\\.[0-9]+$|^Merge master into develop", + }, + "MESSAGES": { + "failure": "Invalid PR Title. Please use the following formats: 'commit type(area of change(optional)): Title'. Refer to the list of [conventional commit types](https://github.com/pvdlg/conventional-commit-types?tab=readme-ov-file#commit-types).", + } +} From 9dd1e90c6420dd47113560e6b2334ae6386bd6a2 Mon Sep 17 00:00:00 2001 From: EttyKitty <20323032+EttyKitty@users.noreply.github.com> Date: Sat, 28 Dec 2024 02:15:26 +0300 Subject: [PATCH 3/5] Update pr-title-checker.yml --- .github/workflows/pr-title-checker.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pr-title-checker.yml b/.github/workflows/pr-title-checker.yml index c1b0e7ca5..22a386d25 100644 --- a/.github/workflows/pr-title-checker.yml +++ b/.github/workflows/pr-title-checker.yml @@ -14,3 +14,4 @@ jobs: with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} pass_on_octokit_error: false + configuration_path: .github/pr-title-checker-config.json #(optional. defaults to .github/pr-title-checker-config.json) From b1bd466a8565c5ad5235ac270fdf7206decc3669 Mon Sep 17 00:00:00 2001 From: EttyKitty <20323032+EttyKitty@users.noreply.github.com> Date: Sat, 28 Dec 2024 02:16:10 +0300 Subject: [PATCH 4/5] Use pull_request instead of pull_request_target Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com> --- .github/workflows/pr-title-checker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-title-checker.yml b/.github/workflows/pr-title-checker.yml index 22a386d25..2cd8bc2fa 100644 --- a/.github/workflows/pr-title-checker.yml +++ b/.github/workflows/pr-title-checker.yml @@ -1,6 +1,6 @@ name: "PR Title Checker" on: - pull_request_target: + pull_request: types: - opened - edited From b77b77dfff0c711917c4b94905dd3124ccca01d1 Mon Sep 17 00:00:00 2001 From: EttyKitty <20323032+EttyKitty@users.noreply.github.com> Date: Sat, 28 Dec 2024 02:24:38 +0300 Subject: [PATCH 5/5] Update pr-title-checker-config.json --- .github/pr-title-checker-config.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/pr-title-checker-config.json b/.github/pr-title-checker-config.json index 3cedbc8ed..e0fc739c7 100644 --- a/.github/pr-title-checker-config.json +++ b/.github/pr-title-checker-config.json @@ -4,9 +4,9 @@ "color": "EEEEEE" }, "CHECKS": { - "regexp": "(feat|fix|ci|chore|docs|test|refactor|revert)(\\([^\\)]+\\))?\\!?: .{1,}$|(?:Bump .+)$|^Release [0-9]+\\.[0-9]+\\.[0-9]+$|^Merge master into develop", + "regexp": "(feat|fix|ci|chore|docs|test|refactor|revert)(\\([^\\)]+\\))?\\!?: .{1,}$|(?:Bump .+)$|^Release [0-9]+\\.[0-9]+\\.[0-9]+$|^Merge master into develop" }, "MESSAGES": { - "failure": "Invalid PR Title. Please use the following formats: 'commit type(area of change(optional)): Title'. Refer to the list of [conventional commit types](https://github.com/pvdlg/conventional-commit-types?tab=readme-ov-file#commit-types).", + "failure": "Invalid PR Title. Please use the following formats: 'commit type(area of change(optional)): Title'. Refer to the list of [conventional commit types](https://github.com/pvdlg/conventional-commit-types?tab=readme-ov-file#commit-types)." } }