Can github actions automatically open web pages?

Viewed 187

My requirement is to automatically open a web page every 5 hours (for example: www.xxx.com, I don't need to see the content of this page, just open it). The page takes 3 minutes to load, and then just close the page.

Can I use Github Actions to achieve my requirement?

1 Answers

Yes, this technically possible. GitHub Actions has the on.schedule event which allows you to essentially set up a cron schedule for execution of your workflow. Your cron schedule for running the workflow every 5 hours would be something like 0 0/5 * * * (see here).

If you just want to open the webpage for 3 minutes, your workflow run step could use the && chaining the URL-opening command (xdg-open www.example.com can be used to open a URL) with a sleep 360. I leave the actual composition of the workflow file as an exercise to the reader .

Related