From 062ef9f0a50ed65231f3cf6963313f3d9f2a8ffe Mon Sep 17 00:00:00 2001 From: Sergey Kuznetsov Date: Mon, 24 Jun 2024 15:11:03 +0100 Subject: [PATCH] ci: added conventional commits check (#1487) Fixes #1366 --- .github/workflows/check_pr_title.yml | 17 +++++++++++++++++ .github/workflows/clang-tidy.yml | 2 +- .github/workflows/clang-tidy_on_fix_merged.yml | 2 +- 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/check_pr_title.yml diff --git a/.github/workflows/check_pr_title.yml b/.github/workflows/check_pr_title.yml new file mode 100644 index 00000000..2cb0130a --- /dev/null +++ b/.github/workflows/check_pr_title.yml @@ -0,0 +1,17 @@ +name: Check PR title +on: + pull_request: + types: [opened, edited, reopened, synchronize] + branches: [develop] + +jobs: + check_title: + runs-on: ubuntu-20.04 + permissions: + pull-requests: write + steps: + - uses: ytanikin/PRConventionalCommits@1.2.0 + with: + task_types: '["feat","fix","docs","test","ci","style","refactor","perf","chore","revert"]' + add_label: true + custom_labels: '{"feat":"enhancement", "fix":"bug", "docs":"documentation", "test":"testability", "ci":"ci", "style":"refactoring", "perf":"performance", "chore":"tooling"}' diff --git a/.github/workflows/clang-tidy.yml b/.github/workflows/clang-tidy.yml index 775a9739..e2aa0d2e 100644 --- a/.github/workflows/clang-tidy.yml +++ b/.github/workflows/clang-tidy.yml @@ -109,7 +109,7 @@ jobs: branch: "clang_tidy/autofix" branch-suffix: timestamp delete-branch: true - title: "[CI] clang-tidy auto fixes" + title: "style: clang-tidy auto fixes" body: "Fixes #${{ steps.create_issue.outputs.created_issue_id }}. Please review and commit clang-tidy fixes." reviewers: "cindyyan317,godexsoft,kuznetsss" diff --git a/.github/workflows/clang-tidy_on_fix_merged.yml b/.github/workflows/clang-tidy_on_fix_merged.yml index c90fbb33..712e4047 100644 --- a/.github/workflows/clang-tidy_on_fix_merged.yml +++ b/.github/workflows/clang-tidy_on_fix_merged.yml @@ -17,7 +17,7 @@ jobs: id: check shell: bash run: | - passed=$(if [[ $(git log -1 --pretty=format:%s | grep '\[CI\] clang-tidy auto fixes') ]]; then echo 'true' ; else echo 'false' ; fi) + passed=$(if [[ $(git log -1 --pretty=format:%s | grep 'style: clang-tidy auto fixes') ]]; then echo 'true' ; else echo 'false' ; fi) echo "passed=$passed" >> $GITHUB_OUTPUT - name: Run clang-tidy workflow