Run audits, backups, smoke tests, or dependency checks on a schedule.

Section: Branching and trigger patterns

Nightly scheduled workflow

yaml
yaml
on:
  schedule:
    - cron: "0 6 * * *"
Explanation

Schedules are ideal for recurring maintenance and longer-running jobs that do not need to run on every commit.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Branching and trigger patterns
Validate pull requests only
Run CI before code reaches main.
OpenIn sheetyamlsame section
Deploy only from main
Restrict production deployment to your protected main branch.
OpenIn sheetyamlsame section
Minimal GitHub Actions pipeline
Build and test on pushes and pull requests.
Minimal GitLab CI pipeline
Run install, test, and build using stages.
Minimal Jenkins declarative pipeline
Run checkout, install, test, and build in a Jenkinsfile.