Skip to content
Latchkey

Scheduled workflow not running (only runs on the default branch) in CI

A scheduled workflow only runs when its file is on the repository default branch (usually main). If you added the schedule trigger on a feature branch, the cron never fires until that file is merged to the default branch.

What this error means

You added an on: schedule workflow, waited past the cron time, and no run appears in the Actions tab. The workflow works when you trigger it manually but the schedule is silent.

.github/workflows/nightly.yml
# .github/workflows/nightly.yml on branch "feature/cron"
on:
  schedule:
    - cron: '0 3 * * *'
# 3:00 UTC passes, no run is created. The Actions tab shows nothing.

Common causes

The workflow file is not on the default branch

GitHub only evaluates schedule triggers from the workflow file on the default branch. A schedule defined on a feature branch is ignored until merged.

The default branch is not what you think

If the default branch is master or develop but the schedule lives on main, the cron will not run from there.

How to fix it

Merge the scheduled workflow to the default branch

  1. Confirm the default branch under Settings > Branches.
  2. Merge the workflow file that contains on: schedule into that branch.
  3. Wait for the next cron slot, or use workflow_dispatch to verify the job body works.
Terminal
git checkout main
git merge feature/cron
git push origin main

Add workflow_dispatch to test without waiting

Combine schedule with workflow_dispatch so you can run the same workflow manually to confirm it is correct before the next cron slot.

.github/workflows/nightly.yml
on:
  schedule:
    - cron: '0 3 * * *'
  workflow_dispatch: {}

How to prevent it

  • Add and test scheduled workflows on the default branch.
  • Always pair schedule with workflow_dispatch for manual verification.
  • Remember that branch edits never change what the schedule runs.

Frequently asked questions

What causes "schedule never fires on a branch"?
GitHub only evaluates schedule triggers from the workflow file on the default branch. A schedule defined on a feature branch is ignored until merged.
How do I fix schedule never fires on a branch?
Merge the scheduled workflow to the default branch

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card