Interview Prep/CI/CD/GitHub Actions

Self-hosted runners are shared by many teams and a job once left secrets on disk for the next job.

AdvancedScenarioGitHub Actions
Answer

Situation read → Persistent runners are not isolated between jobs.

What I'd do →

  1. Use ephemeral runners (--ephemeral) that take one job and exit, via Actions Runner Controller (ARC) on Kubernetes or a VM autoscaler.
  2. Run on dedicated runner groups per team or sensitivity.
  3. Never use self-hosted runners for public repos or untrusted fork PRs.
  4. Clean the work directory and block host Docker socket access.

Why → One job per fresh environment prevents cross-job leakage and persistence.

Interview tip → "Ephemeral and just-in-time" is the answer to self-hosted security.

All CI/CD questions

More on GitHub Actions