name: Issue Labeler

on:
  issues:
    types: [opened]
  pull_request_target:
    types: [opened]
  workflow_dispatch:
    inputs:
      issue-number:
        description: Issue Number
        required: true
        type: string

permissions:
  issues: write
  contents: read

jobs:
  triage:
    runs-on: ubuntu-latest
    steps:
      - uses: github/issue-labeler@v3.4
        with:
          configuration-path: .github/labeler.yml
          enable-versioned-regex: 0
          include-title: 1
          include-body: 0
          repo-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
          issue-number: ${{ github.event.inputs.issue-number || github.event.issue.number || github.event.pull_request.number }}
