Documentation
¶
Index ¶
Constants ¶
const ( // ResultsURLVar is the variable the unpatched runner exports. ResultsURLVar = "ACTIONS_RESULTS_URL" // ResultsURLRenamed is what a patched runner exports GitHub's address // as instead. Same length as ResultsURLVar — see above. ResultsURLRenamed = "ACTIONS_RESULTS_ORL" )
The GitHub runner exports the cache/artifact service address to every step as ACTIONS_RESULTS_URL, taken from the job message. It sets it on the step's own environment, so it overwrites any value the container was started with — which is why ephemerd cannot simply point jobs at its LAN cache with an env var.
PatchResultsURL renames that one string inside Runner.Worker.dll to a name of the same length. The runner then exports GitHub's address under the unused name, and the ACTIONS_RESULTS_URL ephemerd put in the container's environment is what the step sees. This is the technique falcondev-oss/github-actions-cache-server documents; the rename has to be same-length because the string lives in the assembly's #US heap, whose entries are length-prefixed.
Verified against runner 2.337.0 (linux-x64 tarball and the win-x64 zip embedded here): Runner.Worker.dll holds exactly ONE UTF-16LE occurrence and Runner.Common.dll/Runner.Sdk.dll hold none.
Variables ¶
var Version = "unknown"
Runner version embedded at build time.
var WorkerDLL = filepath.Join("bin", "Runner.Worker.dll")
WorkerDLL is the runner assembly that holds the string, relative to the runner root.
Functions ¶
func PatchResultsURL ¶ added in v0.2.23
PatchResultsURL rewrites every UTF-16LE occurrence of ResultsURLVar in data in place. It reports whether data now exports the renamed variable: true when it patched at least one occurrence or data was already patched, false when neither name is present (a runner version that no longer reads the variable from this assembly — the caller must then leave the cache off).
func PatchResultsURLFile ¶ added in v0.2.23
PatchResultsURLFile patches the Runner.Worker.dll under runnerRoot.
When writableRoot is non-empty and differs from runnerRoot, the patched copy is written to writableRoot (an overlay upperdir, or a per-job copy) and runnerRoot is never modified — the shared runner tree must stay byte-identical for jobs that do not use the LAN cache. Otherwise the file is rewritten in place, keeping its mode.
A missing assembly or an absent string is not an error: it returns false and the caller simply does not turn the cache on for the job.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager handles extraction and caching of the embedded GitHub Actions runner.
func (*Manager) ContainerDir ¶
ContainerDir returns the mount target path inside the container.
func (*Manager) Dir ¶
Dir returns the path to the extracted runner directory. The path is OS-specific (e.g. runners/2.333.1-linux) so that macOS and Linux extractions don't collide on shared filesystems (virtio-fs). Call Extract() first to ensure it exists.
func (*Manager) Entrypoint ¶
Entrypoint returns the runner entrypoint command for the current OS.