I have created a self-hosted runner. On my workflow, when describing the job, I use runs-on: self-hosted. But if my self-hosted runner is offline, there won't be any other runner to run that job.
Is there a way to use self-hosted runners when its online, but to let the job run on GitHub hosted runners, if no self-hosted is available?
Part of the desired behavior can be accomplished using runner groups. A GitHub runners group can have both GitHub hosted and self-hosted runners and a GitHub workflow job can be specified to run on a group:
If the
hybrid-runnersgroup have a self-hosted runner and a GitHub hosted runner, in each run, one of the runners will be used for that job. If the self-hosted runner is offline, then the job will necessarily default to the GitHub hosted runner.AFAIK, there is no way to control a preferred runner and its unknown if GitHub already have a bias towards using GitHub hosted or self-hosted runners.