name: Require Changelog Label
on:
  pull_request_target:
    types: [opened, labeled, unlabeled, synchronize]
    branches:
      - "master"
jobs:
  label:
    if: ${{ github.repository_owner == 'jenkinsci' }}
    runs-on: ubuntu-latest
    permissions:
      issues: write
      pull-requests: write
    steps:
      - uses: mheap/github-action-required-labels@8afbe8ae6ab7647d0c9f0cfa7c2f939650d22509 # v5.5.1
        with:
          mode: minimum
          count: 1
          add_comment: true
          message: "Missing required label for changelog. Requires {{errorString}} {{count}} of: {{ provided }}. Found: {{ applied }}.\n\nYou can add the required label by adding a comment with the following text: `/label <category>`"
          labels: |
            bug
            developer
            dependencies
            internal
            localization
            major-bug
            major-rfe
            rfe
            regression-fix
            removed
            skip-changelog
