Github on-schedule action workflow executes in delay or not at all

Viewed 1295

I have 2 workflows inside my repository - one that is a CI that runs on each push and one that is supposed to execute a script on a scheduled time.

The scheduled workflow looks like that:

name: scheduled-run

on:
  schedule:
    # UTC time
    - cron: "45 14 1,15,30 * *"

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
    - name: Set up Python 3.7
      uses: actions/setup-python@v2
      with:
        python-version: 3.7
    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
    - name: Execute python script
      env:
        TELEGRAM_API_TOKEN: ${{ secrets.TELEGRAM_API_TOKEN }}
        TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}
        AWS_KEY_ID: ${{ secrets.AWS_KEY_ID }}
        AWS_SECRET_KEY: ${{ secrets.AWS_SECRET_KEY }}
      run: |
        python cci.py -r

No matter how and to when I set the cron schedule - the workflow does not start! Sometimes it would start way after the supposed time but mostly it does not start. I have tried to recreate the workflow from scratch but it doesn't seem to help. What's going on here?

1 Answers

I tested your workflow with slightly changed cron

name: scheduled-run

on:
  schedule:
    # UTC time
    - cron: "55 13,14,15 1,4,15,30 * *"

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
    - name: Set up Python 3.7
      uses: actions/setup-python@v2
      with:
        python-version: 3.7

And it works as expected:

enter image description here

Please try with sth smaller (like above) and with slightly different cron so you would not wait long to verify your changes.

Related