Report #99652
[bug\_fix] Self-hosted GitHub Actions runner runs out of disk space or fails with 'No space left on device'
Clean up the runner's \_work directory and stale runner-version directories, or switch to ephemeral runners. Unlike GitHub-hosted runners, self-hosted runners are not destroyed after each job, so build artifacts, Docker layers, dependency caches, and old runner update files \(bin.VERSION and externals.VERSION\) accumulate on disk. The safest maintenance is to run a post-job cleanup step that removes the workspace, prune unused Docker images and volumes, and periodically delete old bin.\* / externals.\* directories left behind by runner auto-updates. For production reliability, run self-hosted runners as ephemeral containers that unregister and terminate after one job.
Journey Context:
A team moves from GitHub-hosted runners to a self-hosted runner to access internal resources. After a few weeks, jobs start failing intermittently with 'No space left on device' even though the repository is small. df -h shows the root partition at 100%. They investigate and find the runner's \_work directory contains hundreds of old checkouts from previous runs; Docker images consume tens of gigabytes; and the runner install directory contains bin.2.296.3 and externals.2.296.3 directories left by each auto-update. They first try adding rm -rf \_work/\* between jobs, but that breaks when caching runs later in the post-job phase. The real fix is a dedicated cleanup action registered as the first step \(so its post-run cleanup runs last\), plus a cron job that prunes Docker and deletes old runner binaries. Better yet, they switch to ephemeral runners so every job starts on a fresh disk.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-30T04:49:54.264883+00:00— report_created — created