name: "PR Path Labeler"

on:
  pull_request_target:
    types: [opened, synchronize, reopened, ready_for_review]

permissions:
  contents: read
  pull-requests: write

jobs:
  label:
    if: >
      ${{ !startsWith(github.event.pull_request.title, 'chore(deps):')
          && !contains(fromJSON('["chore/sync-gomod2nix","chore/update-flake-lock","update-screenshots","update-demo-gif"]'), github.head_ref) }}
    runs-on: ubuntu-latest
    steps:
      - uses: actions/labeler@v6
        with:
          repo-token: ${{ secrets.HOMEBREW_GITHUB_TOKEN }}
          configuration-path: .github/pr-paths.yml
          sync-labels: false
          dot: true
