GitHub Actions: scheduled workflow not triggering [2026 fix]

CRON syntax error or branch protection preventing scheduled jobs. Fix: validate cron expression and ensure default branch matches workflow location.

GitHub Actions: Scheduled Workflow Not Triggering at 2AM

TL;DR

Cause: Invalid CRON syntax in schedule: trigger OR workflow file not on default branch. Fix: Validate CRON expression at crontab.guru and ensure .github/workflows/ files are committed to your default branch.

---

Real Console Error Messages

You won't see these in GitHub Actions UI—they appear in workflow logs or local testing:

``` Error: The workflow is not valid. .github/workflows/deploy.yml: The schedule event does not contain any valid cron expressions ```

``` Warning: Scheduled workflow will not run because this workflow file contains no on: schedule: trigger matching the current branch ```

``` Scheduled workflow skipped: This workflow file is not on the default branch (main). Scheduled events only trigger on the default branch. ```

``` Error in workflow: Invalid cron expression "0 2 * * *" does not match GitHub's restricted schedule format (5-minute minimum interval) ```

``` Workflow dispatch failed: The workflow file .github/workflows/job.yml could not be read from refs/heads/main ```

---

Broken Code → Exact Fix

Problem 1: Invalid CRON Syntax

❌ BROKEN: ```yaml name: Nightly Deploy on: schedule: - cron: '0 2 * * *' # Looks fine but... jobs: deploy: runs-on: ubuntu-latest steps: - run: echo "Deploying" ```

✅ FIXED: ```yaml name: Nightly Deploy on: schedule: - cron: '0 2 * * *' # UTC only! No DST adjustment # Format: minute hour day month day-of-week # Always use UTC. GitHub does NOT apply timezone conversion. jobs: deploy: runs-on: ubuntu-latest steps: - run: echo "Deploying" ```

Why it failed: GitHub Actions CRON uses UTC only. If you're in EST and want 2AM local time, you must calculate: 2AM EST = 7AM UTC (winter) or 6AM UTC (summer). GitHub does not auto-adjust for DST.

---

Problem 2: Workflow Not on Default Branch

❌ BROKEN: ```bash

You committed to feature branch

git checkout -b feature/new-deploy git add .github/workflows/schedule.yml git commit -m "Add scheduled workflow" git push origin feature/new-deploy

← Scheduled workflows NEVER trigger from feature branches

```

✅ FIXED: ```bash

Merge to default branch (main/master)

git checkout main git merge feature/new-deploy git push origin main

Now the workflow will trigger on schedule

Verify it's on default branch:

Settings → General → Default branch (should show your branch)

```

Why it failed: GitHub Actions scheduled triggers only execute on your repository's default branch. Feature branches are ignored, even if they contain valid workflow files.

---

Problem 3: CRON Expression Violates 5-Minute Minimum

❌ BROKEN: ```yaml on: schedule: - cron: '*/1 * * * *' # Every minute = INVALID ```

✅ FIXED: ```yaml on: schedule: - cron: '*/5 * * * *' # Every 5 minutes = VALID # OR for 2AM daily: - cron: '0 2 * * *' ```

Why it failed: GitHub enforces minimum 5-minute intervals. Sub-5-minute schedules are silently rejected.

---

Validation Checklist

1. CRON syntax: Test at [crontab.guru](https://crontab.guru) and verify UTC time (not your local timezone) 2. Default branch: Confirm .github/workflows/ files are on your repository's default branch (Settings → General → Default branch) 3. File exists: Run git ls-tree -r HEAD | grep .github/workflows/ to verify workflow is actually committed 4. Permissions: Ensure branch protection rules allow Actions to push (if using read-only tokens) 5. Clear cache: Delete and re-push the workflow file if changes aren't detected: ```bash git rm .github/workflows/schedule.yml git commit -m "Remove workflow" git push origin main # Wait 30 seconds git restore .github/workflows/schedule.yml git add .github/workflows/schedule.yml git commit -m "Re-add workflow" git push origin main ```

---

Still broken? Check these too

1. Branch protection rules blocking scheduled jobs: Go to Settings → Branches → Branch protection rules. If "Require pull request reviews" is enabled, scheduled workflows may fail on merge. Disable for Actions or use GITHUB_TOKEN with proper permissions.

2. Workflow disabled in UI: Navigate to Actions tab → find your workflow. If it shows "disabled", click the "Enable workflow" button. Workflows are auto-disabled if they haven't run in 60 days.

3. Repository archived or private with limited Actions: Archived repositories don't trigger scheduled events. Private repos may require explicit Actions enablement: Settings → Actions → General → Allow all actions and reusable workflows.

---

Related Guides

  • [GitHub Actions: Workflow Not Running on Push](/?guide=github-actions-push-trigger)
  • [GitHub Actions: Permission Denied Errors](/?guide=github-actions-permissions)
  • ---

    Official Documentation

    [GitHub Actions: Events that trigger workflows - Scheduled events](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#scheduled-events)

    ---

    Found a different variation? Drop it in the comments—scheduled workflow bugs are often environment-specific, and your fix might save the next person's 2AM sprint.

    🔥 0d
    LIVE
    PlanetScale rage spiking Vercel pricing complaints Railway gaining fast Supabase happiness rising Resend loved by devs PlanetScale rage spiking Vercel pricing complaints Railway gaining fast Supabase happiness rising
    DEVELOPER PAIN RADAR // Loading...

    Developers complain.
    Opportunities appear.

    We track what developers are struggling with today — and what opportunities that creates.

    guides today
    avg happiness
    🔥 Pain
    📖 Guides
    🔭 Explore
    👤 Mine
    🔥 Pain Radar — rage scores today
    ↗ share
    💡 Opportunity Feed — pain = market gap
    📈 Tool Momentum
    all scores →
    📖 Latest Guide
    all guides →
    📖 All Guides
    📊 Tool Scores
    + Submit
    📰 Hacker News
    ➕ Submit a Tool
    ← back