Example workflow
This workflow runs at 06:30 UTC on weekdays and can also be started by hand from the Actions tab:
name: Nightly checks
on:
schedule:
- cron: "30 6 * * 1-5"
workflow_dispatch:
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm ci && npm testRules GitHub adds on top of cron
- Times are in UTC. Convert your local time first; the tool above shows both.
- The shortest interval is every 5 minutes. A more frequent schedule still runs at most every 5 minutes.
- Quote the expression. A value starting with
*is YAML alias syntax, socron: */5 * * * *without quotes is a YAML error. - Runs can start several minutes late, or be dropped, when GitHub is under heavy load. The start of each hour is the busiest time, so an odd minute like
17is more reliable than0. - Scheduled workflows run on the latest commit of the default branch. A schedule in a workflow file on another branch never runs.
- In public repositories, scheduled workflows are disabled automatically after 60 days without repository activity. Re-enable them from the Actions tab.
Several schedules in one workflow
A workflow can list more than one cron. github.event.schedule holds the expression that started the run, so steps can behave differently:
on:
schedule:
- cron: "0 3 * * *" # nightly
- cron: "0 12 * * 0" # Sunday noon
jobs:
report:
runs-on: ubuntu-latest
steps:
- if: github.event.schedule == '0 12 * * 0'
run: echo "Weekly summary"Frequently asked questions
Why isn't my scheduled GitHub Action running?
Check that the workflow file is on the default branch, that the cron is quoted and valid, and that the workflow hasn't been disabled for inactivity. A new or changed schedule can also take a little while before its first run.
How do I run a GitHub Actions schedule at a local time?
Convert the local time to UTC and write that in the cron. If your time zone has daylight saving, the run moves by an hour twice a year; to avoid it, schedule both UTC hours and let the first step exit unless the local time is the one you want.
Does GitHub Actions support seconds or @daily in cron?
No. GitHub Actions takes the five standard fields only, without a seconds field or shortcuts like @daily and @hourly. Write 0 0 * * * instead of @daily.