name: Label PRs

on:
  pull_request:
    types: [opened]

jobs:
  label_prs:
    runs-on: ubuntu-latest
    permissions:
      issues: write
      pull-requests: write
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - name: Label PRs
        uses: actions/github-script@v7
        with:
          script: |
            const label_pr = require('./.github/assets/label_pr.js')
            await label_pr({github, context})
