name: Labels

permissions:
  contents: read
on:
  pull_request:
    types: [labeled, unlabeled, opened, reopened, edited, synchronize]
jobs:
  enforce-labels:
    name: Check for blocking labels
    runs-on: ubuntu-latest
    timeout-minutes: 2
    steps:
    - uses: yogevbd/enforce-label-action@a3c219da6b8fa73f6ba62b68ff09c469b3a1c024 # 2.2.2
      with:
        # REQUIRED_LABELS_ANY: "bug,enhancement,skip-changelog"
        # REQUIRED_LABELS_ANY_DESCRIPTION: "Select at least one label ['bug','enhancement','skip-changelog']"
        BANNED_LABELS: "needs docs,needs compat annotation,needs more info,needs nanosoldier run,needs news,needs pkgeval,needs tests,needs decision,DO NOT MERGE,status:DO NOT MERGE"
        BANNED_LABELS_DESCRIPTION: "A PR should not be merged with `needs *` or `status:DO NOT MERGE` labels"
