# Taken from https://github.com/pymc-labs/pymc-marketing/tree/main/.github/workflows/slow-tests-issue.yml
# See the scripts in the `scripts/slowest_tests` directory for more information
---
name: Slow Tests Issue Body

on:
  workflow_dispatch:
  schedule:
    - cron: '0 */6 * * *'

permissions:
  issues: write

jobs:
  update-comment:
    runs-on: ubuntu-latest
    steps:
      - name: Install ZSH
        run: sudo apt-get update && sudo apt-get install -y zsh
      - name: Checkout code
        uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
      - name: Set up Python
        uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
        with:
          python-version: "3.11"
      - name: Trigger the script
        working-directory: scripts/slowest_tests
        shell: zsh {0}
        run: source update-slowest-times-issue.sh
        env:
          GITHUB_TOKEN: ${{ github.token }}
