From 018de117b43c04832fbccc5095d04797de1c62d0 Mon Sep 17 00:00:00 2001 From: Martin Marosi Date: Fri, 25 Oct 2024 13:37:46 +0200 Subject: [PATCH] chore: add commitlint to CI check --- .github/workflows/ci.yaml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a79fabbe6..494b4caa7 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -84,3 +84,23 @@ jobs: - uses: './.github/actions/cache' - name: Lint run: npx nx affected -t test:lint --exclude=demo + commitlint: + needs: [install] + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: './.github/actions/cache' + - name: install + shell: bash + run: npm i + - name: Validate current commit on push + shell: bash + if: github.event_name == 'push' + run: npx commitlint --last --verbose + - name: Validate PR commits + shell: bash + if: github.event_name == 'pull_request' + run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose