name: "Pull Request Triage"
on:
  pull_request_target:
    types: [opened, ready_for_review]

jobs:
  triage:
    permissions:
      contents: read
      pull-requests: write

    runs-on: ubuntu-latest

    steps:
      - name: Update labels based on changes
        uses: actions/labeler@v4
        with:
          sync-labels: true
          dot: true

      - name: Auto Assign [Audio]
        uses: kentaro-m/auto-assign-action@v1.2.5
        with:
          configuration-path: '.github/assign/audio.yml'

      - name: Auto Assign [CPU]
        uses: kentaro-m/auto-assign-action@v1.2.5
        with:
          configuration-path: '.github/assign/cpu.yml'

      - name: Auto Assign [GPU]
        uses: kentaro-m/auto-assign-action@v1.2.5
        with:
          configuration-path: '.github/assign/gpu.yml'

      - name: Auto Assign [GUI]
        uses: kentaro-m/auto-assign-action@v1.2.5
        with:
          configuration-path: '.github/assign/gui.yml'

      - name: Auto Assign [Horizon]
        uses: kentaro-m/auto-assign-action@v1.2.5
        with:
          configuration-path: '.github/assign/horizon.yml'

      - name: Auto Assign [Infra]
        uses: kentaro-m/auto-assign-action@v1.2.5
        with:
          configuration-path: '.github/assign/infra.yml'

      - name: Auto Assign [Global]
        uses: kentaro-m/auto-assign-action@v1.2.5
        with:
          configuration-path: '.github/assign/global.yml'