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

permissions:
  contents: read

jobs:
  labeler:
    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@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
      with:
        egress-policy: audit

    - uses: actions/labeler@bf12e9b00b37c5c0ca2b87b79b2daf7891dbda13 # v7.0.0
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
