name: PR
on:
  pull_request:
    types:
      - opened
      - reopened
      - edited
      - synchronize

jobs:
  check-title:
    runs-on: ubuntu-latest
    steps:
      - name: install
        run: |
          npm install -g @commitlint/cli @commitlint/config-conventional
          echo "module.exports = {extends: ['@commitlint/config-conventional']}" > commitlint.config.js
      - name: lint
        run: |
          echo "${{github.event.pull_request.title}}" | commitlint
