Before you start
Authenticate the GitHub CLI for the target repository. The token needs Administration: write to create the temporary runner and Actions: write to start the workflow. Set the repository once for the commands below:Add the workflow
Add this file to the repository’s default branch. Replace the final step with the commands you want the runner to execute..github/workflows/microsandbox-runner.yml
Run one job
1
Queue the workflow
The job waits until the temporary runner connects.
2
Create the runner VM
Give this runner a unique name so multiple jobs can run independently.
3
Register and start the runner
First, ask GitHub to register this VM as a runner for one job. GitHub returns a single-use configuration containing the repository address, runner identity, labels, and temporary credentials.Next, pass that configuration through standard input to GitHub’s runner process inside the microVM:The runner now opens an outbound HTTPS long poll to GitHub and waits. No inbound port or public IP is required. GitHub returns the queued job through that request, and the command exits when the job finishes.
4
Remove the VM
After the job completes, stop and delete the sandbox.
gh stays on the host. Only the single-use JIT configuration enters the VM, and the workflow receives only the permissions declared in its YAML. No host directory or Docker socket is mounted into the runner.
To keep accepting jobs, run the same four steps from a long-lived machine or service whenever a matching workflow job is queued. For a larger runner fleet, see GitHub’s self-hosted runner autoscaling guidance.