Pausing a GitHub Actions cron: the yaml trap that breaks all workflow triggers
DEV Community

Pausing a GitHub Actions cron: the yaml trap that breaks all workflow triggers

After 11 uploaded videos disappeared from YouTube overnight, I wanted to stop the automated upload schedules while I investigated. The fix seemed trivial: comment out the cron lines in two workflow files. I've done this before without thinking about it. Today it broke two unrelated things. Here's what went wrong and how to pause a cron correctly.

The mistake: commenting out the cron line but leaving the key

The original yt-publish.yml looked like this:

on:
  push:
    branches: [ main ]
  schedule:
    - cron: '0 21 * * 1,3,5'

My first attempt at pausing was:

on:
  push:
    branches: [ main ]
  schedule:
    # - cron: '0 21 * * 1,3,5'

That leaves schedule: as a key with no value. In YAML terms, schedule: with no value is a null scalar, which is valid YAML - but GitHub Actions doesn't accept it. Its workflow schema requires schedule to be a sequence. An empty schedule: key fails validation. I did the same thing in yt-publish-longform.yml. Two workflows now in a broken state.

How the failure shows up

The cryptic part: the error doesn't say "invalid schedule". GitHub's runner rejects the whole workflow file and the failure appears on every trigger, including push. The Actions tab shows:

  • Run status: failed
  • Run duration: 0s
  • Message: "This run likely failed because of a workflow file issue."

At 0s, no job has started. It's a pre-parse failure. Because both affected workflows had a push trigger as well as schedule, every commit to main for the next hour showed red checks.

The failing workflow was the upload pauser, not any of the actual build or publish workflows - so at first the red commits looked related to something I'd pushed, not to the yaml edit. The tell: 0s duration. Any real job failure takes at least a few seconds to allocate a runner. A 0s failure almost always means the workflow file didn't parse.

The fix: comment out the entire schedule key

The correct way to pause a cron without disabling other triggers is to comment out the key itself. GitHub's workflow syntax docs require schedule to be a non-empty sequence - an empty mapping key fails schema validation.

on:
  push:
    branches: [ main ]
  # schedule:
  #   โš  PAUSED 2026-08-11 - uncomment this line AND the cron line below to resume
  #   - cron: '0 21 * * 1,3,5'

With schedule: itself commented out, the on: block

Read on DEV Community ↗ ← Back to News

Comments

No comments yet. Start the discussion.