name: Commitlint
on:
  pull_request:
    types: [opened, synchronize, edited]
env:
  ATL_NODE_VERSION: '16.17.0'
jobs:
  lint-commits:
    runs-on: ubuntu-latest
    timeout-minutes: 5
    steps:
      - uses: actions/checkout@v3.3.0
        with:
          fetch-depth: 0
      - uses: actions/setup-node@v3
        with:
          node-version: ${{ env.ATL_NODE_VERSION }}
      - name: install
        run: npm i -g @commitlint/config-conventional
      - name: commitlint
        run: npx commitlint --from HEAD~${{ github.event.pull_request.commits }} --to HEAD
