name: Schedule update for other branches
on:
  # Runs every Saturday at noon
  schedule:
    - cron: "0 12 * * SAT"

# Allow running workflows
permissions:
  actions: write

jobs:
  update:
    name: Trigger updates for nixvim's stable branches
    runs-on: ubuntu-latest
    strategy:
      matrix:
        branches:
          - nixos-24.11
    steps:
      - name: Update ${{ matrix.branches }}
        env:
          GH_TOKEN: ${{ github.token }}
          repo: ${{ github.repository }}
          branch: ${{ matrix.branches }}
        run: |
          gh --repo "$repo" workflow run \
            update.yml --ref "$branch"
