---
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Sync Labels

on:
  push:
    branches:
      - main
      - master
    paths:
      - '.github/labels.yml'
      - '.github/workflows/sync-labels.yml'
  schedule:
    - cron: '34 5 * * *' # Run every day at 05:34 AM UTC
  workflow_call:
  workflow_dispatch:
  merge_group:

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

permissions:
  contents: read # read repository contents

jobs:
  labels:
    name: ♻️ Sync Labels
    runs-on: ubuntu-latest
    timeout-minutes: 10

    permissions:
      contents: read # read the labels definition
      issues: write # create and update repository labels

    steps:
      - name: ⤵️ Checkout Repository
        uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          persist-credentials: false
      - name: ⤵️ Sync Latest Labels Definitions
        uses: ivuorinen/actions/sync-labels@94a4f68a6b95ecc1677fbcac1683119fd869adf7 # v2026.07.04
