name: labels
on:
  push:
    branches:
      - main
    paths:
      - .github/labels.yml
      - .github/workflows/labels.yml
  pull_request: # dry run only
    paths:
      - .github/labels.yml
      - .github/workflows/labels.yml

jobs:
  labeler:
    permissions:
      contents: read
      issues: write
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: crazy-max/ghaction-github-labeler@548a7c3603594ec17c819e1239f281a3b801ab4d #v6.0.0
        with:
          dry-run: ${{ github.event_name == 'pull_request' }}
