GitHub Actions Schedule vs Cron vs Apps Script Triggers: Which to Use for Scheduled Jobs

Disclosure: I build Pocket Actions, an iPhone app for running workflows manually — not a scheduler. I mention it only in the section on manual runs. Platform facts are from official docs (linked) as of the last-checked date.

The job

You have a small recurring task: fetch some data each morning, send a weekly report, clean up a sheet. Three common places to schedule it:

  1. GitHub Actions on: schedule
  2. cron on a server or VPS you run
  3. Google Apps Script (GAS) time-driven triggers

GitHub Actions schedule

From Events that trigger workflows:

  • POSIX cron syntax; shortest interval is every 5 minutes.
  • Runs on the latest commit of the default branch only.
  • Times are UTC by default; a timezone key with an IANA zone is supported.
  • Shorthands like @daily aren't supported.
  • Can be delayed during high load, especially at the start of every hour; if load is high enough, some queued jobs may be dropped. GitHub suggests picking a different minute.
  • In public repositories, scheduled workflows are automatically disabled after 60 days with no repository activity (disable/enable docs).

Cost (billing): standard runners are free in public repos. Private repos use the included amount (GitHub Free: $12/month of compute; Linux 2-core $0.006/min), then billing — or blocked if no payment method.

Good for: anything code-based (Python, Node, CLI tools), secrets in repo settings, logs and failure notifications from GitHub, no server to maintain. Bad for: exact timing, sub-5-minute frequency.

on:
  schedule:
    - cron: "17 22 * * *"   # avoid :00
      timezone: "Asia/Tokyo"
  workflow_dispatch:        # also allow manual runs

Cron on your own server

Classic crontab: minute-level precision, any language, as long as the machine is up.

  • Pros: precise timing, every minute if you want, no platform quotas, access to local resources/databases.
  • Cons: you maintain the server (updates, uptime, disk, security), failures are silent unless you add monitoring (cron mails output only if mail is configured), and the server costs money even when idle.

Google Apps Script time-driven triggers

From Installable triggers and Quotas:

  • Intervals from every minute up to monthly, or a specific date/time.
  • Time is slightly randomized: a trigger set for 9 a.m. fires sometime between 9 and 10, then keeps that time.
  • 6 minutes max per execution.
  • Total trigger runtime: 90 min/day (consumer accounts), 6 hr/day (Google Workspace).
  • 20 triggers per user per script.
  • On failure, Google emails a summary (frequency configurable).
  • Free with a Google account; native access to Sheets, Gmail, Drive, Calendar.

Good for: Google Workspace chores, short jobs, no repo or server. Bad for: long runs, heavy libraries, Python.

Comparison table

Comparison table
GitHub Actions scheduleServer cronGAS time-driven
Timing precisionCan be delayed (esp. :00); may dropPreciseRandomized within the hour
Min interval5 min1 min1 min
Time zoneUTC default, timezone keyServer's TZ / CRON_TZ (impl-dependent)Script's time zone
Max run lengthJob limits (long)Unlimited6 min
LanguagesAnyAnyJavaScript
CostFree public / included quota privateServer costFree (quotas)
Failure alertsGitHub notificationsDIYEmail summary
MaintenanceWorkflow fileWhole serverScript only
GotchaPublic repo disabled after 60 inactive daysServer down = no run90 min/day trigger total (consumer)

The same job, set up three ways

To make the comparison concrete, here is one small job — "fetch some data each morning and save a summary" — built on each platform, with the parts people usually forget.

GitHub Actions: a complete scheduled workflow

# .github/workflows/morning.yml
name: Morning summary
on:
  schedule:
    - cron: "17 22 * * *"      # 22:17 UTC; avoid minute 0
  workflow_dispatch:            # manual run, same job
    inputs:
      verbose:
        type: boolean
        default: false

concurrency:
  group: morning
  cancel-in-progress: false

jobs:
  run:
    runs-on: ubuntu-latest
    timeout-minutes: 15
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: "3.12"
      - run: pip install -r requirements.txt
      - run: python summary.py
        env:
          API_KEY: ${{ secrets.API_KEY }}
          VERBOSE: ${{ inputs.verbose || false }}
      - run: cat summary.md >> "$GITHUB_STEP_SUMMARY"

Notes:

  • timeout-minutes stops a hung job from burning minutes. The default job limit is much longer, so set your own (workflow syntax).
  • concurrency stops a manual run and a scheduled run from overlapping.
  • $GITHUB_STEP_SUMMARY puts Markdown on the run page, so you can read the result in a browser or GitHub Mobile without opening logs (workflow commands).
  • inputs.verbose || false: on a scheduled run there are no inputs, so give a fallback.
  • Secrets go in Settings → Secrets and variables → Actions, never in the file.

Converting times: if you don't use the timezone key, write the cron in UTC. 7:17 a.m. in Tokyo (UTC+9) is 17 22 * * * the previous day in UTC.

Server cron: a crontab line that won't bite you

# crontab -e
SHELL=/bin/bash
PATH=/usr/local/bin:/usr/bin:/bin
MAILTO=""

17 7 * * * cd /opt/morning && /usr/bin/flock -n /tmp/morning.lock ./venv/bin/python summary.py >> /var/log/morning.log 2>&1

What each piece prevents (crontab(5)):

  • PATH: cron runs with a minimal environment, so commands that work in your terminal may not be found. Use absolute paths.
  • cd first: relative file paths in your script resolve against the home directory otherwise.
  • flock -n: if yesterday's run is somehow still going, today's exits instead of piling up (flock(1)).
  • Log redirection: without MAILTO and a mail setup, output goes nowhere. >> log 2>&1 keeps a record.
  • % is special in crontab: it ends the command and starts stdin. Escape it as \% (for example inside date +\%F).

Time zone handling depends on the cron implementation and system settings; some support CRON_TZ, others don't. Check man 5 crontab on your server.

Apps Script: creating the trigger in code

You can add a time-driven trigger in the editor (the clock icon → Add Trigger), but creating it in code makes it reproducible (ScriptApp ClockTriggerBuilder):

function setupTrigger() {
  // Remove old triggers for this handler so you don't end up with duplicates
  ScriptApp.getProjectTriggers()
    .filter(t => t.getHandlerFunction() === 'morning')
    .forEach(t => ScriptApp.deleteTrigger(t));

  ScriptApp.newTrigger('morning')
    .timeBased()
    .atHour(7)          // fires sometime in the 7 o'clock hour
    .everyDays(1)
    .inTimezone('Asia/Tokyo')
    .create();
}

function morning() {
  const lock = LockService.getScriptLock();
  if (!lock.tryLock(1000)) return;      // another run is in progress
  try {
    const key = PropertiesService.getScriptProperties().getProperty('API_KEY');
    const res = UrlFetchApp.fetch('https://example.com/data', {
      headers: { Authorization: 'Bearer ' + key },
      muteHttpExceptions: true,
    });
    if (res.getResponseCode() !== 200) throw new Error('HTTP ' + res.getResponseCode());
    SpreadsheetApp.getActive().getSheetByName('log')
      .appendRow([new Date(), res.getContentText().slice(0, 500)]);
  } finally {
    lock.releaseLock();
  }
}
  • Run setupTrigger once by hand. Running it twice without the cleanup creates two triggers, and the job fires twice.
  • Keep keys in Script Properties (PropertiesService), not in code.
  • LockService prevents overlap if a manual web-app run and the trigger collide (LockService).
  • Throwing an error is what makes the failure email fire. If you catch errors and swallow them, Google sees a success.

If a job approaches the 6-minute limit, split it: process a batch, save your position in Script Properties, and let the next trigger continue.

Pitfalls by platform

Pitfalls by platform
SymptomPlatformCause and fix
Scheduled run never happensActionsWorkflow isn't on the default branch, or it was auto-disabled after 60 days of inactivity in a public repo. Re-enable it in the Actions tab
Run starts 10–30+ minutes lateActionsHigh load around the top of the hour. Move the minute off 0, and don't depend on exact timing (actual delay varies; unconfirmed range)
Works in terminal, fails in cronCronMinimal environment: set PATH, use absolute paths, cd first
Nothing in logs at allCronNo redirection and no mail. Add >> file 2>&1
Job runs twiceGASDuplicate triggers. List them under Triggers in the editor and delete extras
"Exceeded maximum execution time"GASOver 6 minutes. Batch the work and continue on the next run
"Service invoked too many times"GASA daily quota was hit (quotas). Reduce calls or spread them out
Inputs are empty on scheduled runsActionsScheduled runs have no inputs. Provide defaults in the expression

Monitoring, the boring part that matters

  • Actions: GitHub can notify you of failed workflow runs (Settings → Notifications → Actions). You can also add a final step with if: failure() that posts to Slack or another chat tool.
  • Cron: add a heartbeat. At the end of a successful run, ping a monitoring URL; if the ping doesn't arrive, the monitor alerts you. Without something like this, a dead server is silent.
  • GAS: the failure email is on by default for installable triggers; check the notification setting on the trigger if you aren't getting them.

Don't forget manual runs

Schedules miss things: a delayed or dropped Actions run, a randomized GAS time, a server reboot — or you simply want a result now, not at 7 a.m. tomorrow. Giving the same job a manual trigger covers this:

  • GitHub Actions: add workflow_dispatch alongside schedule; run it from the web, gh workflow run, GitHub Mobile, a Shortcut, or Pocket Actions.
  • GAS: deploy the function as a web app, then open its URL or call it from a phone (guide).
  • Cron: SSH in and run the script (from a phone, via an SSH app — specific apps not reviewed here).

Pocket Actions runs workflow_dispatch workflows and GAS web apps in 1–3 taps. Limits: runs always target main; GAS runs show success even if your script throws; no logs in the app; iOS only; free for 5 runs/day and 17/week.

Three realistic scenarios

"Post yesterday's sales from a spreadsheet to chat at 8 a.m." The data is already in Google Sheets and the job takes seconds. A GAS time-driven trigger is the natural fit: no repository, no server, native Sheets access. The randomized minute rarely matters for a morning report. Add a web-app doGet so you can re-send it by hand when someone asks.

"Scrape three sites, run a Python analysis, commit a CSV." This needs Python packages and may run for several minutes. GitHub Actions schedule fits: pip works, secrets live in the repository, and the CSV can be committed back. Put the cron off the hour, add workflow_dispatch for reruns, and accept that it may start late.

"Poll an internal API every minute and alert if it's down." Minute-level precision, access to an internal network, no tolerance for dropped runs. That points to cron on a machine you control (or a dedicated monitoring service). Neither GitHub's schedule nor GAS is designed for this.

The pattern: choose by where the data lives and how much timing matters, then add a manual trigger to whichever you chose.

One more check before you commit to a platform: who else will maintain this? A GAS project tied to one person's Google account, or a crontab on one person's VPS, is easy to lose track of when that person moves on. A workflow file in a shared repository is at least visible to everyone with access.

Which should you choose?

  • Code job, don't care about exact minute, no server: GitHub Actions schedule (+ workflow_dispatch).
  • Must run at a precise time, or every minute, or needs local resources: server cron.
  • Google Sheets/Gmail chores under 6 minutes: GAS time-driven trigger.
  • Mostly on demand: skip the schedule; use a manual trigger.

A real example

My stock-evaluation workflow (AI scores stocks I'm curious about) isn't on a schedule at all — I run it manually from my phone when I need it, so I don't burn minutes on days I don't care.

Try it

View Pocket Actions on the App Store

FAQ

Why is my GitHub Actions schedule late? Scheduled runs can be delayed under high load, especially at the top of the hour, and may be dropped. Use an off-peak minute and add workflow_dispatch for manual runs.

What time zone does GitHub Actions cron use? UTC by default. You can set a timezone key with an IANA time zone.

Why did my scheduled workflow stop? In public repositories, scheduled workflows are disabled after 60 days without repository activity. Re-enable it in the Actions tab.

Do Apps Script time triggers run at an exact time? No. The time is slightly randomized, e.g. a 9 a.m. trigger runs between 9 and 10.

How long can a GAS triggered function run? Six minutes per execution, with a daily total trigger runtime of 90 minutes on consumer accounts.

Last checked: 2026-11-01 (GitHub Docs events and billing; Google Apps Script triggers and quotas; crontab(5)).