Using cron in a workflow
Add a schedule trigger to your workflow file: on: schedule: - cron: '30 5 * * 1-5'. The expression uses the usual five fields (minute, hour, day of month, month, day of week) and must be quoted in YAML because * is a special character. You can list several cron entries, and github.event.schedule tells the job which one fired.
UTC and the 5-minute limit
Schedules are always evaluated in UTC, so 0 9 * * * runs at 09:00 UTC, not in your local time; use the tool’s local-time column to translate. The shortest interval GitHub supports is every five minutes. Macros such as @daily are not supported, so write out the fields.
Delays and inactive repositories
Scheduled runs can start late during periods of high load, especially at the top of the hour, so choose an odd minute such as 17 instead of 0 when timing isn’t critical. In public repositories, scheduled workflows are disabled automatically after 60 days without repository activity.
Testing scheduled workflows
Add workflow_dispatch next to schedule so you can start the workflow manually while you test it. Remember that schedules only run from the default branch, so a cron change on a feature branch has no effect until it is merged. A concurrency group prevents a slow run from overlapping with the next scheduled one.
Frequently asked questions
- What time zone does GitHub Actions cron use?
- UTC, always. There is no setting to change it, so convert your local time to UTC when writing the expression.
- Can a workflow run every minute?
- No. The minimum interval is five minutes; more frequent schedules are run at most every five minutes.
- Why didn’t my scheduled workflow run on time?
- Scheduled jobs are queued and may be delayed under load, and they only run on the default branch. Workflows in inactive public repositories are also paused.
- Can I use @daily in GitHub Actions?
- No. Use the equivalent five fields, for example 0 0 * * *.