GitHub Actions Offline Runner removed?

Hello! I’m using GitHub - philips-labs/terraform-aws-github-runner: Terraform module for scalable GitHub action runners on AWS to create self-hosted Runners inside AWS. This code has the feature that it uses EC2 Spot instances, can bring up and then can bring down the set of active Runners to zero (so no cost when Runners are not active). To be able to bring the set of Runners down to zero, yet still have GitHub able to trigger the webhook to the AWS API Gateway, an ‘offline runner’ must be created.

What I’ve seen is that sometimes this ‘offline runner’ mysteriously disappears from the GitHub Organization I create it in. Is there a timeout that is triggered to prune ‘offline runners’ from a Repository or Organization? Is there a log of this activity somewhere? Is there any way to ensure that an ‘offline runner’ is never purged from an Organization’s Runner list?

Thanks in advance! This is a head-scratcher! :wink:


According to the documentation in Removing self-hosted runners the inactivity expiry is 30 days:

A self-hosted runner is automatically removed from GitHub if it has not connected to GitHub Actions for more than 30 days.

The simplest workaround for this would be to create a Workflow that runs on a weekly[1] schedule, e.g:

    - cron:  '0 0 0 * * 0'

    runs-on: offline-runner
      - run: echo "Awaken, My Love\!"

[1] Weekly because every 29 days is a little trickier to represent in cron format and so I think the simplicity is worth the additional cost of 3 more runs, however, if the additional cost is an issue then you could do it every 29 days!

1 Like