A simple, and somewhat contrived, demo showing the use of GitHub Actions on a schedule.
This is defined in the GitHub Action yaml file and is specified to run on schedule
, as opposed to push
or pull_request
. This is further contrived in that npm executes the default test
script, with its output of Error: no test specified
.
If you're wondering why to use a scheduled action, there are some use cases for scheduled testing. This would likely not have anything to do with unit tests, but with integration tests or a generic browser test involving production site uptime, etc. This is not an ideal form of testing, but could be a stop gap under certain use cases.
You can see the scheduled executions under the Actions tab, filtering on event:schedule
.
- GitHub Actions docs
- GitHub Actions docs on triggering events, permalink to scheduled events
- corntab, great for computing "crontab" schedule values
MIT