A developer adds a nightly integration-test workflow with a valid cron expression to the branch feature/nightly and pushes it. A push-triggered workflow on the same branch runs normally, but after two days the nightly workflow has never started. The repository's default branch is main. What explains the missing runs?
Choose one.
Scheduled workflows run only from the default branch.
The schedule event reads the workflow file on the repository's default branch. A cron that exists only on a feature branch is ignored, even though push and pull_request triggers on that branch work normally. Merging the workflow to main makes the schedule active. Manual first runs, approvals and open pull requests have no effect on schedules.
- Note which trigger works (push) and which does not (schedule).
- Recall where GitHub reads schedule triggers from: the default branch only.
- Check the branch the file was pushed to: a feature branch.
- Conclude the schedule is never registered until the file reaches main.
Exam tip: A cron trigger counts only when the workflow file is on the default branch.
GitHub Actions Triggers, Events, Caching, Artifacts and Outputs (GH-200) — the lesson that teaches this.