name: Auto-update labels
on:
  push:
    paths:
      - 'misc/triage/labels.yaml'
    branches:
      - main
jobs:
  deploy:
    name: Auto-update labels
    runs-on: ubuntu-latest
    steps:
      - name: Checkout main
        uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

      - name: Set up Go
        uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
        with:
          go-version-file: go.mod
          cache: false

      - name: Install Go tools
        run: go install tool # GOBIN is added to the PATH by the setup-go action

      - name: update labels
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: mage label