name: 'GitHub Pages Check'
on:
  workflow_dispatch:
  schedule:
    - cron: 0 6 * * 1

concurrency:
  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
  cancel-in-progress: true

permissions: {}

jobs:
  url-check:
    name: GitHub Pages check
    runs-on: ubuntu-latest
    steps:
      - name: Checkout GitHub Pages
        uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10  # v6.0.3
        with:
          ref: 'gh-pages'
          path: 'gh-pages'
          persist-credentials: false
      - name: Checkout main (tools)
        uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10  # v6.0.3
        with:
          ref: main
          path: main
          persist-credentials: false
      - name: Setup Python
        uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405  # v6.2.0
        with:
          python-version: '3.x'
      - name: Check GitHub Pages
        run: |
          export PYTHONPATH="$GITHUB_WORKSPACE"
          python main/.github/scripts/check_gh_pages_updates.py
