Skip to content

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.sh and Dockerfile from the sf-github-runner build repository, as uploaded.
  • The scanframe-org/sf-workflows README on GitHub.
  • The avolphen/amd64-github-runner page on Docker Hub.
  • The actions/runner documentation 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:

  1. zip-file exports /actions-runner/externals from the Docker image into /tmp/runner-externals.zip.
  2. zip-mount mounts that zip at /tmp/runner-externals using fuse-zip.
  3. start runs the container and passes the mount path to the runner as RUNNER_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-runner is a fork of actions/runner. It contains only the runner code changes and no build files, so the diff stays suitable for an upstream pull request.
  • sf-github-runner builds and tests the Docker image on top of myoung34/github-runner. It includes the fork as a Git submodule.
  • sf-workflows uses 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 the externals mount. When unset, the stock behaviour is kept.
  • The mount target inside the job container stays /__e.
  • StepHost matches paths against both the mount source and the mount target. A runner path such as /actions-runner/externals/node24/bin/node becomes /__e/node24/bin/node.
  • Path matching respects directory boundaries. For example, /foo/bar2 no 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.

  1. Restart after reboot. start uses --restart unless-stopped. After a reboot, the container may start before zip-mount has run. The bind mount then points at an empty directory, and jobs fail because node24/bin/node is missing.
  2. Root for allow_other. zip-mount uses -o allow_other. The Docker daemon runs as root, so a FUSE mount needs allow_other, which requires user_allow_other in /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.
  3. Docker group membership. Access to the Docker socket is effectively root-equivalent.
  4. Registry requirement. zip-file calls require_registry, so it fails unless NEXUS_REPOSITORY is set. The public image avolphen/amd64-github-runner could supply the externals instead.
  5. Missing check. zip-mount reports a missing fuse-zip command but does not exit.
  6. Secrets. GITHUB_PAT is passed as an environment variable, so anyone who can run docker inspect can read it.
  7. Privileged container. The runner runs with --privileged and the host Docker socket. That is reasonable for a private organization, but it should be documented.
  8. 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 main and cherry-pick only the relevant commits.
  • Consider splitting the path-boundary fix in StepHost into 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.md in actions/runner describes contributing through issues and pull requests, building with dev.sh, running tests before commits, and forking the repository for pushes. It also specifies .NET Foundation and CoreCLR style guidelines.
  • A CONTRIBUTING.md file was not found. Its absence should be confirmed before the pull request is opened.
  • Related issues:
  • #2115 covers the /__e/node*/bin/node mechanism. 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-runner and 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.md is absent upstream, or find it.
  • Open the upstream pull request after rebasing and splitting the change.