How to Schedule a GitHub Actions Workflow (Cron)
A schedule trigger runs a workflow on a cron timetable - useful for nightly builds, cleanups, and dependency checks.
Add on.schedule with one or more POSIX cron expressions. Times are always UTC, and the workflow must be on the default branch to fire.
Cron schedule
This runs every day at 02:30 UTC. You can list multiple - cron: entries.
.github/workflows/nightly.yml
on:
schedule:
- cron: '30 2 * * *' # 02:30 UTC daily
jobs:
nightly:
runs-on: ubuntu-latest
steps:
- run: ./nightly-checks.shGotchas
- Cron is UTC only - there is no timezone field.
- Scheduled runs can be delayed (or dropped) during high load; do not rely on exact-minute timing.
- Schedules pause automatically after 60 days of repo inactivity, and only run on the default branch.
Related guides
How to Trigger a GitHub Actions Workflow ManuallyTrigger a GitHub Actions workflow manually with workflow_dispatch - add an input form, run from the UI or gh…
How to Schedule a Pipeline in GitLab CISchedule a GitLab CI pipeline with pipeline schedules and the $CI_PIPELINE_SOURCE == "schedule" rule to run n…