From 3f514615cadd465e9d8a2f44097940bc9bf19bb0 Mon Sep 17 00:00:00 2001 From: r34son Date: Sat, 14 Oct 2023 18:28:46 +0300 Subject: [PATCH] ci: added commitlint check --- .github/workflows/ci.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 375a355..0053e0a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,7 +7,8 @@ on: branches: ['master'] jobs: - unit: + validate: + name: Validate runs-on: ubuntu-latest steps: @@ -26,6 +27,14 @@ jobs: - name: Install dependencies run: pnpm install + - name: Validate current commit (last commit) with commitlint + if: github.event_name == 'push' + run: pnpm exec commitlint --from HEAD~1 --to HEAD --verbose + + - name: Validate PR commits with commitlint + if: github.event_name == 'pull_request' + run: pnpm exec commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose + - name: Run the tests and generate coverage report run: pnpm test -- --coverage