GitHub Actions: scheduled workflow not triggering [2026 fix]
CRON syntax error or branch protection rules blocking scheduled runs. Fix: validate cron in crontab.guru and allow actions on default branch.
GitHub Actions: Scheduled Workflow Not Triggering – 2am Emergency Fix
TL;DR
Cause: Invalid CRON syntax or scheduled workflows disabled on your default branch due to branch protection rules. Fix: Validate cron expression at crontab.guru and ensure branch protection doesn't require approval for scheduled actions.---
Common Error Messages
Here are exact console outputs you'll see in GitHub Actions logs:
``` Error: Invalid cron syntax ```
``` Scheduled workflow did not run. This repository has branch protection rules that may prevent scheduled workflows from running. ```
``` Workflow file error: The workflow is not valid. .github/workflows/schedule.yml (Line 5): Cron expression is invalid: "0 2 * * *" is not a valid cron expression ```
``` Warning: Scheduled workflow skipped. Required status check 'GitHub Actions' must succeed, but scheduled workflows cannot trigger checks. ```
``` Scheduled workflow failed to trigger. No push events detected on default branch within the last 35 days. ```
---
Problem #1: Invalid CRON Expression
Broken Code
```yaml name: Nightly Deploy on: schedule: - cron: "2 * * *" # WRONG: missing minute/hour separator jobs: deploy: runs-on: ubuntu-latest steps: - run: echo "Deploying..." ```Exact Fix
```yaml name: Nightly Deploy on: schedule: - cron: "0 2 * * *" # CORRECT: 2:00 AM UTC every day jobs: deploy: runs-on: ubuntu-latest steps: - run: echo "Deploying..." ```Why it broke: GitHub Actions uses POSIX cron format: minute hour day month day-of-week. Your expression had only 4 fields instead of 5.
Validation: Always test at [crontab.guru](https://crontab.guru) before committing.
---
Problem #2: Branch Protection Rules Block Scheduled Workflows
Broken Code
```yaml name: Scheduled Backup on: schedule: - cron: "0 3 * * 0" # Sunday 3 AM UTC jobs: backup: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - run: ./backup.sh ```GitHub UI Settings (causing the block):
Exact Fix
Option A: Modify Branch Protection (Recommended) 1. Go to Settings → Branches → Branch protection rules 2. Find your default branch rule 3. Under "Require status checks to pass before merging", uncheck or remove GitHub Actions checks 4. OR check "Allow specified actors to bypass required pull requests" and add your GitHub Actions bot
Option B: Use Personal Access Token ```yaml name: Scheduled Backup on: schedule: - cron: "0 3 * * 0" jobs: backup: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: token: ${{ secrets.WORKFLOW_TOKEN }} # Personal access token - run: ./backup.sh ```
Create WORKFLOW_TOKEN [here](https://github.com/settings/tokens) with workflow scope.
---
Problem #3: Workflow Not Pushed to Default Branch
Broken Code
```bash git checkout -b feature/add-scheduleCreate .github/workflows/schedule.yml on this branch
git push origin feature/add-schedulePR created but NOT MERGED to main/master
```Exact Fix
```bashMerge your PR to the default branch FIRST
git checkout main git pull origin main git merge feature/add-schedule git push origin mainNow the scheduled workflow will trigger
```Why it broke: GitHub Actions only runs scheduled workflows from files on your default branch (usually main or master). Feature branches are ignored.
---
Problem #4: No Activity in 35+ Days
Note on version behavior: As of 2024, GitHub disables scheduled workflows if there's been no push activity in 35 days. This applies across all GitHub versions.
Fix: Push any change to your default branch: ```bash git commit --allow-empty -m "Reactivate scheduled workflows" git push origin main ```
---
Still Broken? Check These Too
1. Workflow file syntax errors – Run yamllint .github/workflows/schedule.yml locally. Even one space off breaks it.
2. Timezone confusion – GitHub Actions cron runs in UTC only. If you need 2 AM EST (UTC-5), use cron: "0 7 * * *" instead.
3. permissions block too restrictive – If your workflow has permissions: {}, add permissions: { contents: read } for checkout to work.
---
Verification Checklist
.github/workflows/ on default branch (not a feature branch)minute hour day month weekday---
Official Resources
[GitHub Actions: Scheduling workflows documentation](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule)
[Crontab.guru expression builder](https://crontab.guru)
Related guides: [GitHub Actions secrets setup](/?guide=github-actions-secrets) [Fixing branch protection conflicts](/?guide=branch-protection-fixes)
---
Found a different variation? Drop it in the comments – include your exact cron expression and error message to help the next 2am troubleshooter.