From 3e5ab285ceadb807dd0fd7cd169a964b07420ef2 Mon Sep 17 00:00:00 2001 From: yyzxw <1020938856@qq.com> Date: Wed, 27 Mar 2024 15:51:44 +0800 Subject: [PATCH] Feat: add pr title check step Signed-off-by: yyzxw <1020938856@qq.com> --- .github/pr-title-checker-config.json | 10 ++++++++++ .github/workflows/commit-lint.yml | 22 ++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 .github/pr-title-checker-config.json create mode 100644 .github/workflows/commit-lint.yml diff --git a/.github/pr-title-checker-config.json b/.github/pr-title-checker-config.json new file mode 100644 index 000000000..d12359173 --- /dev/null +++ b/.github/pr-title-checker-config.json @@ -0,0 +1,10 @@ +{ + "LABEL": { + "name": "title-needs-formatting", + "color": "EEEEEE" + }, + "CHECKS": { + "prefixes": ["Fix: ", "Feat: ", "Docs: ", "Test: ", "Chore: ", "CI: ", "Perf: ", "Refactor: ", "Revert: ", "Style: ", "Test: ", + "Fix(", "Feat(", "Docs(", "Test(", "Chore(", "CI(", "Perf(", "Refactor(", "Revert(", "Style(", "Test(", "[Backport"] + } +} \ No newline at end of file diff --git a/.github/workflows/commit-lint.yml b/.github/workflows/commit-lint.yml new file mode 100644 index 000000000..7ef9dc1da --- /dev/null +++ b/.github/workflows/commit-lint.yml @@ -0,0 +1,22 @@ +name: PR Title Checker +on: + pull_request: + types: + - opened + - edited + - synchronize + - labeled + - unlabeled + +permissions: + pull-requests: read + +jobs: + check: + runs-on: ubuntu-22.04 + steps: + - uses: thehanimo/pr-title-checker@v1.4.1 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + pass_on_octokit_error: true + configuration_path: ".github/pr-title-checker-config.json"