name: PR Size Labeler

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

permissions:
  contents: read
  pull-requests: write

jobs:
  size-label:
    runs-on: ubuntu-latest
    steps:
      - name: Label PR by size
        uses: codelytv/pr-size-labeler@v1
        with:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          xs_label: 'size/XS'
          xs_max_size: '10'
          s_label: 'size/S'
          s_max_size: '100'
          m_label: 'size/M'
          m_max_size: '500'
          l_label: 'size/L'
          l_max_size: '1000'
          xl_label: 'size/XL'
          message_if_xl: |
            这个 PR 改动较大（超过 1000 行），建议拆分成多个小 PR 以便 Review。

            This PR is quite large (over 1000 lines). Consider splitting it into smaller PRs for easier review.
