- Published
- Author
- Swasthik K
Cron in GitHub Actions
In GitHub Actions, you can schedule workflows using cron syntax inside the
Example:
Cron format:
#GitHubActions #DevOps
In GitHub Actions, you can schedule workflows using cron syntax inside the
on.schedule field. It uses UTC time format.Example:
Code
on:
schedule:
# Runs at 5:30 AM and 5:30 PM UTC every day
- cron: '30 5,17 * * *'
# Runs every 15 minutes
- cron: '*/15 * * * *'
# Runs every Monday at 9:00 AM UTC
- cron: '0 9 * * 1'Cron format:
┌───────── minute (0–59)│ ┌─────── hour (0–23)│ │ ┌───── day of month (1–31)│ │ │ ┌─── month (1–12)│ │ │ │ ┌─ day of week (0–6, Sun=0)│ │ │ │ │* * * * *#GitHubActions #DevOps