Why should self-hosted runners not be used with public repositories?
AdvancedConceptCaching, Artifacts, Runners & ARC
Answer
Anyone can fork a public repo and open a PR whose workflow (or modified build script) runs on your runner. With a persistent runner, that code can install a backdoor, steal credentials from the host (cloud metadata service, Docker socket, kubeconfig), pivot into your network, or poison the next job. Approval settings for fork PRs reduce but do not remove the risk. If unavoidable: ephemeral runners in an isolated network, no instance role, no secrets on the host, and require approval for all outside contributors.
More on Caching, Artifacts, Runners & ARC
How does `actions/cache` match keys and restore keys?IntermediateWhich caches can a branch restore from?AdvancedWhat are the cache size limits and eviction rules?BeginnerWhen should you use setup-* built-in caching instead of `actions/cache`?BeginnerWhy cache the package manager's download cache rather than `node_modules`?AdvancedHow do `actions/cache/restore` and `actions/cache/save` help?Advanced