name: Python Run - every 5 hours run a Python script and then commit to repo on: schedule: - cron: '0 */5 * * *' # Run every 5 hours, every day workflow_dispatch: # Grant write permissions for all jobs in this workflow permissions: contents: write jobs: build: runs-on: ubuntu-latest timeout-minutes: 4 strategy: matrix: python-version: ["3.14"] steps: - name: Checkout repository uses: actions/checkout@v7 # Action to clone the repo - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v7 with: python-version: ${{ matrix.python-version }} # Specify the Python version - name: Cache pip packages id: pip-cache uses: actions/cache@v6 with: # Cache key includes OS, Python version, and a hash of the lock file key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} # Restore from any previous cache with the same OS and Python version restore-keys: | ${{ runner.os }}-pip- # Directories to cache (default pip cache location) path: | ~/.cache/pip - name: Install dependencies run: | if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Run version_increment.py run: python version_increment.py - name: Run create_cosmetic_list_v2.py run: python create_cosmetic_list_v2.py - name: Run create_block_list_v1.py run: python create_block_list_v1.py - name: Run split_block_list_v1.py run: python split_block_list_v1.py - name: Commit and push changes run: | git config user.name 'github-actions[bot]' git config user.email 'github-actions[bot]@users.noreply.github.com' git add . git commit -m "update filterlist" git push env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # SOURCES: # https://github.com/actions/setup-python # https://github.com/actions/checkout # https://github.com/actions/cache # OLD: # python -m pip install --upgrade pip # Updated: 2026-06-22 16:33:18 +10:00 # - adjusted schedule to every 5 hours to account for GitHub delay.