Sometimes you may want to shut down GitHub runners to perform maintenance.
This may cause race conditions where a job is scheduled while a runner is shutting down.
Assuming you're selecting your runners via a custom label (i.e. runs-on: custom-label
), this script gracefully
prepares the runners for shutdown by removing custom labels (which prevents jobs new from being scheduled).
It then waits for the runners to be idle.