name: Commit Lint

on:
  pull_request:
    branches: [master]

jobs:
  commit_lint:
    name: "Lint commit messages"
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0
      - uses: actions/setup-node@v3
        with:
          node-version: 16
      - run: yarn install --frozen-lockfile
      - run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
