astrochun
astrochun

Reputation: 1796

GitHub Actions cronjob trigger seems to trigger an hour later

While I have used GitHub Actions (with push triggers), I'm fairly new to scheduling them based on specified time. Simply: I have a simple cronjob running on GitHub Actions with the following trigger:

on:
  schedule:
    - cron: "0 0 * * *"

This should run at UTC 0h daily, but what I'm seeing in the logs is that it starts at least 1 hour later, between 01:04-01:11 UTC. I understand that GitHub Actions scheduling is such that it can be delayed by minutes and such, but this seem odd that it's delayed by more than an hour in a fairly consistent manner for a week and a half now.

Anyone have an idea how to fix this? I know this is small, but it's kind of nagging and something I wanted to understand should I need events to happen at specified time.

Upvotes: 11

Views: 3120

Answers (1)

GuiFalourd
GuiFalourd

Reputation: 22970

When you set up a GitHub Actions workflow with a schedule, you're essentially requesting GitHub to schedule that workflow for you. There is no guarantee that the workflow will run exactly at that time.

In a discussion in the GitHub Support Community (No assurance on scheduled jobs?), Github partner @brightran said that many times, there may be a delay when triggering the scheduled workflow:

Generally, the delay time is about 3 to 10 minutes. Sometimes, it may be more, even dozens of minutes, or more than one hour.

He also said that if the delay time is too long, the scheduled workflow may be not triggered at that day. Therefore, it's not recommended to use GitHub Actions scheduled workflows for production tasks that require execution guarantee.

Source

Upvotes: 6

Related Questions