name: Lint pull request title

on:
  pull_request:
    types:
      - opened
      - edited
      - synchronize
      - ready_for_review

permissions:
  pull-requests: read

jobs:
  main:
    name: Run git-sumi
    runs-on: ubuntu-24.04
    steps:
      - name: Set header length for dependency updates
        if: contains(github.event.pull_request.title, 'chore(deps)')
        run: echo "GIT_SUMI_MAX_HEADER_LENGTH=80" >> $GITHUB_ENV
      - uses: welpo/git-sumi-action@main
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
