Instructor: In addition to triggering GitHub actions on push, we can schedule GitHub actions to occur using cron syntax. Note that scheduled workflows will get run with the latest commit on the default branch.
To understand how to schedule GitHub actions using cron, we can use crontab guru. Crontab guru will show us a minute, hour, day, month, and day of the week. Using this display, we can click on the field that we want to change, look at the options available to us, and choose one.
Note that now the next time this cron job will run is at 2:05. Crontab guru has a set of examples that can be found. If you want to run ever Friday, every hour at 30 minutes, or every day at 1:00 AM. Let's look at the every five minutes.
The syntax to run every five minutes uses a star, a slash, and a five in the minute category. All of the other fields will be set to any value. Let's go to our GitHub workflow.
This GitHub workflow runs echo. Currently, our workflow is run on push. Let's change that.
We'll change this to run on schedule. Note that we have to wrap our string in quotes because star is a special character in YAML. We'll commit this.
Let's go back to our actions tab. The workflow now runs on a schedule. Note that our action is now running every five minutes.