Interview: Custom GitHub Actions Runner with Configurable Externals
Subject: Recent work on the scanframe-org runner repositories Date: 1 December 2026
Sources
The facts below come from the interview answers and from these files and pages:
README.md,build.shandDockerfilefrom thesf-github-runnerbuild repository, as uploaded.- The
scanframe-org/sf-workflowsREADME on GitHub. - The
avolphen/amd64-github-runnerpage on Docker Hub. - The
actions/runnerdocumentation and issues, found through search.
The contents of the sf-github-runner and scanframe-org/actions-runner GitHub pages could not be read during the interview because of rate limits. Their details come from the uploaded files and from the interviewee.
1. The problem
Q: What made the stock runner hard to use?
The stock runner expects its externals directory at /actions-runner/externals on the host. Writing to that path requires root access on the root of the file system. Unlike GitLab runners, a GitHub runner cannot simply be cloned and started. Setting one up is, in the interviewee's words, "a hassle just to get a GitHub runner working."
Q: Why is the externals directory needed?
It holds the Node.js runtimes that JavaScript actions need. A container job receives it mounted at /__e. The runner passes its own install path to the Docker daemon as the mount source, and the daemon resolves that path on the host, not inside the runner container. This is why the host must contain the directory.
2. The goal
Q: What do you want to achieve?
- A file server holds the cloned repository and is shared over NFS to several systems.
- Any system, such as a workstation, can become a build server in seconds, without root access.
- On dedicated build servers, a service keeps the runner running. For those, the interviewee plans to use
/var/lib/github-runner/externals.
3. The approach
Q: How do you provide the externals without root?
The externals are packed into a single zip file, which is far faster to copy and mount than thousands of small files. The workflow is:
zip-fileexports/actions-runner/externalsfrom the Docker image into/tmp/runner-externals.zip.zip-mountmounts that zip at/tmp/runner-externalsusingfuse-zip.startruns the container and passes the mount path to the runner asRUNNER_EXTERNALS_HOST_PATH.
Copying the zip is an acceptable alternative to regenerating it on every host.
Q: Why does the NFS share not need to hold the same path everywhere?
Only the zip file lives on the share. Each host mounts it locally, so the Docker daemon on that host sees the externals at the same path the container uses. The shared path does not have to match between machines.
4. The repositories
Q: How is the work organized?
actions-runneris a fork ofactions/runner. It contains only the runner code changes and no build files, so the diff stays suitable for an upstream pull request.sf-github-runnerbuilds and tests the Docker image on top ofmyoung34/github-runner. It includes the fork as a Git submodule.sf-workflowsuses the resulting image in its CI pipeline.
Q: Why was this structure chosen?
The earlier proof of concept was not well organized. The current layout keeps the fork clean and separates the image build from the workflows that consume it.
5. The runner fork
Q: What changes does the fork make?
- It adds the optional environment variable
RUNNER_EXTERNALS_HOST_PATH. When set, its value is the host source of theexternalsmount. When unset, the stock behaviour is kept. - The mount target inside the job container stays
/__e. StepHostmatches paths against both the mount source and the mount target. A runner path such as/actions-runner/externals/node24/bin/nodebecomes/__e/node24/bin/node.- Path matching respects directory boundaries. For example,
/foo/bar2no longer matches/foo/bar. - Debug lines report the mount source, target, and the selected Node runtime.
- Unit tests cover the default, the override, invalid paths, and path translation with a custom mount source.
Q: Which change was the last one needed?
The StepHost change. It made the mount resolve to the correct position inside the job container.
6. Status
Q: Does it work?
Yes. A full job has completed on one machine, and the runner stayed up to take the next job. The README in sf-github-runner still lists end-to-end behaviour as unconfirmed, so that section needs updating.
7. Known issues and risks
These came from reviewing the uploaded scripts. They have not all been tested by the interviewee.
- Restart after reboot.
startuses--restart unless-stopped. After a reboot, the container may start beforezip-mounthas run. The bind mount then points at an empty directory, and jobs fail becausenode24/bin/nodeis missing. - Root for
allow_other.zip-mountuses-o allow_other. The Docker daemon runs as root, so a FUSE mount needsallow_other, which requiresuser_allow_otherin/etc/fuse.conf. That file is editable only by root, so each host needs a one-time root step. An extracted directory would avoid this. - Docker group membership. Access to the Docker socket is effectively root-equivalent.
- Registry requirement.
zip-filecallsrequire_registry, so it fails unlessNEXUS_REPOSITORYis set. The public imageavolphen/amd64-github-runnercould supply the externals instead. - Missing check.
zip-mountreports a missingfuse-zipcommand but does not exit. - Secrets.
GITHUB_PATis passed as an environment variable, so anyone who can rundocker inspectcan read it. - Privileged container. The runner runs with
--privilegedand the host Docker socket. That is reasonable for a private organization, but it should be documented. - Path naming. The interviewee first referred to
/tmp/actions-runner. The script uses/tmp/runner-externals, which is the correct path.
8. Upstream contribution
Q: What is the plan for an upstream pull request?
- Rebase the change onto the current upstream
mainand cherry-pick only the relevant commits. - Consider splitting the path-boundary fix in
StepHostinto its own pull request. - Keep the feature opt-in and say so in the description.
- Include the tests, rerun them on the rebased branch, and reference the end-to-end result.
- Use the README's "Why this repository exists" section as the basis for the description.
Upstream findings:
docs/contribute.mdinactions/runnerdescribes contributing through issues and pull requests, building withdev.sh, running tests before commits, and forking the repository for pushes. It also specifies .NET Foundation and CoreCLR style guidelines.- A
CONTRIBUTING.mdfile was not found. Its absence should be confirmed before the pull request is opened. - Related issues:
- #2115 covers the
/__e/node*/bin/nodemechanism. It is closed but still referenced. - #716 covers host paths in container contexts. It is still discussed.
- #3241 reports
exec /__e/node20/bin/node: no such file or directory, which the fix addresses. It was open as of April 2024. - An earlier statement about upstream requiring prior agreement before code changes came from a fork's copy of the documentation, not from upstream. It should not be treated as upstream policy.
- Existing upstream pull requests for custom externals paths have not been searched.
9. Open items
- Confirm the end-to-end result in
sf-github-runnerand update its README. - Fix or document the restart-after-reboot behaviour.
- Decide between the FUSE approach and an extracted directory, depending on whether root is available on each host.
- Search upstream issues and pull requests for custom externals paths.
- Confirm that
CONTRIBUTING.mdis absent upstream, or find it. - Open the upstream pull request after rebasing and splitting the change.