Schedule Runs
GitHub Actions can be scheduled to run at a given time or interval. To express this the action should be configured using crontab
notation.
So when you have a workflow, you can add a schedule to the on
hook like so:
on:
schedule:
- cron: "0 0 * * *"
For more information, do see the introductory blog post by Jason Etcovitch: , which gives a nice overview.
I have some repositories where much do not happen, so in order to make sure they still build I have added the following schedule.
on:
schedule:
- cron: '0 10 */30 * *'
This schedules builds, tests and emits a coverage report for this particular repository every 30 days (around every month), so even though I do not commit anything, I make sure that things are still working.
Do note the hour is 10:00 UTC, so if it fails I will get a notification in the morning.
The example is lifted from my punycode project, see the file: go.yml
.
Resources and References
- Blog post by Jason Etcovitch:
- crontab.guru - your crontab scheduling wizard
- GitHub: Action Scheduling Documentation