name: "Pull Request Labeler"
on:
  pull_request_target:
    types: [opened, reopened]

permissions:
  contents: read

jobs:
  triage:
    permissions:
      pull-requests: write # Labeler needs to be able to add labels to PRs.
    runs-on: ubuntu-latest
    steps:
    - name: Harden Runner
      uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1
      with:
        egress-policy: audit

    - uses: actions/labeler@ac9175f8a1f3625fd0d4fb234536d26811351594 # v4.3.0
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
