name: Sync Labels

on:
  push:
    branches:
      - main
    paths:
      - '.github/labels.yml'
      - '.github/workflows/labels.yml'
  workflow_dispatch:

jobs:
  sync:
    runs-on: ubuntu-latest
    permissions:
      issues: write
      contents: read

    steps:
    - uses: actions/checkout@v4

    - name: Sync labels
      uses: micnncim/action-label-syncer@v1
      with:
        manifest: .github/labels.yml
        repository: ${{ github.repository }}
        token: ${{ secrets.GITHUB_TOKEN }}
        prune: false
