GitHub Actions schedule cron not triggering (default branch only)
Scheduled workflows always run against the version of the workflow on the repository default branch. A schedule defined only on a feature branch will never fire.
What this error means
A cron-scheduled workflow does not run on time, while the same file exists only on a non-default branch.
github-actions
# This schedule only fires if this file is on the DEFAULT branch
on:
schedule:
- cron: '0 6 * * *'Common causes
Schedule defined off the default branch
Cron triggers are evaluated from the default branch copy only.
Repository inactivity disabling schedules
Scheduled workflows can be auto-disabled after long repo inactivity.
How to fix it
Place the schedule on the default branch
- Merge the workflow with on: schedule to the default branch.
- Confirm the repo is active so schedules are not auto-disabled.
- Remember cron times are UTC and may run with some delay.
.github/workflows/nightly.yml
on:
schedule:
- cron: '0 6 * * *' # 06:00 UTC daily, from default branchHow to prevent it
- Define schedules on the default branch and keep the repo active.
- Account for UTC and possible scheduling delay during peak load.
Frequently asked questions
What causes "schedule cron not triggering"?
Cron triggers are evaluated from the default branch copy only.
How do I fix schedule cron not triggering?
Place the schedule on the default branch
Related guides
GitHub Actions "Workflow does not exist" (workflow_dispatch on non-default branch)Fix "Workflow does not exist" when dispatching - workflow_dispatch is only available once the workflow file e…
GitHub Actions "Workflow file changed during run"Fix a GitHub Actions run that fails because the workflow file changed while it was executing - runs are pinne…
GitHub Actions if condition always runs (string vs expression)Fix a GitHub Actions if condition that always runs - a bare string in if is truthy, so the step never skips.