Github hosted runner: handling scale-in for autoscaling groups

I am porting our organisation’s infrastructure from gitlab to github. One thing I haven’t yet found in the documentation is how to handle scale-in events.

Our self-hosted runners are run as a AWS EC2 autoscaling group. As each instance starts, it registers itself with the github runner group without any problem. I have code which detects the level of activity on our instances to generate metrics, which influence the scale in and scale out behaviours.

With gitlab, when an instance is being scaled in, I am able to instruct the agent to finish the current jobs, without accepting any more jobs. Only once the current jobs are finished do I allow AWS to actually stop the instance. How do I perform the same task with github self-hosted runners?

I have checked the REST API and there is nothing there. Neither config.sh nor svc.sh seem to support this either. How should it be done, to support scaling in with causing running jobs to fail?