name: LSP Update check

on:
  schedule:
    - cron: '0 10 * * 1-5' # 10AM UTC (2AM PDT) MON-FRI

jobs:
  update-lsp:
    name: Check for LSP update and create issue
    runs-on: ubuntu-latest
    permissions:
      issues: write

    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Use Python 3.10
        uses: actions/setup-python@v5
        with:
          python-version: '3.10'

      - name: Update pip, install wheel and nox
        run: python -m pip install -U pip wheel nox PyGithub
        shell: bash

      - name: Run Checker
        run: python ./.github/workflows/lsp_updater.py
        env:
          GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
