diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index a7440eb..5287f92 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -38,3 +38,16 @@ jobs: - name: make test run: make test + + - name: Install commitlint + run: | + npm install conventional-changelog-conventionalcommits + npm install commitlint@latest + + - name: Validate current commit (last commit) with commitlint + if: github.event_name == 'push' + run: npx commitlint --from HEAD~1 --to HEAD --verbose + + - name: Validate PR commits with commitlint + 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