name: 'Commitlint' on: push: branches: - main pull_request: permissions: contents: read # to fetch code (actions/checkout) actions: read jobs: commitlint: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - uses: actions/setup-node@v4 with: node-version: 20 - uses: nrwl/nx-set-shas@v4 - name: Monorepo install uses: ./.github/actions/yarn-nm-install - name: Validate PR commits with commitlint if: github.event_name == 'pull_request' run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose