name: PR Size Check

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

jobs:
  pr-size:
    runs-on: ubuntu-latest
    permissions:
      pull-requests: write
    steps:
      - uses: codelytv/pr-size-labeler@095a41fca88b8764fd9e008ad269bcdb82bb38b9 # v1
        with:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          xs_label: "size/XS"
          xs_max_size: 25
          s_label: "size/S"
          s_max_size: 100
          m_label: "size/M"
          m_max_size: 250
          l_label: "size/L"
          l_max_size: 500
          xl_label: "size/XL"
          fail_if_xl: false
          files_to_ignore: |
            uv.lock
            *.lock
            lib/crewai/src/crewai/cli/templates/**
            **/*.json
            **/test_durations/**
            **/cassettes/**