name: Label based on PR size

on:
  pull_request:
  workflow_dispatch:

jobs:
  size-label:
    permissions: write-all
    runs-on: ubuntu-latest

    steps:

      - name: size-label
        if: >-
          (
            github.event_name == 'pull_request' &&
            github.event.pull_request.head.repo.full_name == github.repository
          ) || (
            github.event_name == 'workflow_dispatch'
          )
        uses: "pascalgn/size-label-action@v0.5.7"
        env:
          GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
