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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

      - name: Set up Go
        uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.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