name: Update cell lists

on:
  workflow_dispatch:
  schedule:
    - cron: '0 4 1,15 * *'

jobs:
  update_warncells:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Repo
        uses: "actions/checkout@v4"

      - name: Setup Python
        uses: actions/setup-python@v5
        with:
          python-version: '3.12'

      - name: Install Python Packages
        run: |
          python -m pip install --upgrade pip
          pip install .

      - name: Execute Python Scripts
        run: |
          python update_biocell_list.py
          python update_pollencell_list.py
          python update_warncell_list.py
        working-directory: ./docs

      - name: Create Pull Request
        uses: peter-evans/create-pull-request@v6
        with:
          commit-message: Update cell lists
          title: Update cell lists
          body: Update cell lists to reflect changes by DWD
          branch: update-celllists
          delete-branch: true