name: Lint PR Title

on:
  pull_request:
    types: [opened, edited, synchronize, reopened]

permissions: {}

jobs:
  lint:
    runs-on: ubuntu-latest
    permissions:
      pull-requests: read
    steps:
      - uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6.1.1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          types: |
            feat
            fix
            chore
            docs
            refactor
            revert
            test
            ci
            perf
            build
          requireScope: false
          subjectPattern: ^[^<>]+$
          subjectPatternError: "PR title must not be empty after the type prefix and must not contain < or > characters."
