Expand description
The environment a native runner starts with, beyond what the daemon has.
A runner inherits the daemon’s environment, and a service’s environment is
not a login shell’s. On macOS launchd starts the agent with
PATH=/usr/bin:/bin:/usr/sbin:/sbin and no LANG, so a job finds no
Homebrew tool (actions/cache falls back from zstd to gzip and never
hits), and nothing the operator put in a shell profile reaches it. A classic
runner gets those from the .env and .path files its config.sh writes;
a just-in-time runner never runs config.sh.
Two things fill the gap, applied to every native runner in this order, each overriding the one before:
- Platform defaults (
platform_defaults): on macOS, Homebrew’s directories ahead of the inheritedPATHand a UTF-8LANG; on Windows, a profile of the runner’s own (USERPROFILE,HOME,APPDATA,LOCALAPPDATA) inside the attempt, so concurrent jobs stop sharing the service account’s~/.bun, npm cache and pnpm store. Linux has none. - The host’s
runner.env(RunnerEnv):KEY=VALUElines in the configuration directory, edited withrunner-manager host env. A name set here replaces the platform default of the same name outright.
The per-attempt temporary directory (TMPDIR, TEMP, TMP) is applied
last and cannot be overridden, and neither can GitHub’s
ACTIONS_RUNNER_INPUT_* inputs, one of which carries the JIT
configuration: RESERVED_NAMES and RESERVED_PREFIX.
§Not a secret store
The file is plain text in the configuration directory and every runner’s
environment can read it back. Nothing here logs or prints a value except
host env show, which exists to show them; errors name a line or a
variable, never what it was set to.
Structs§
- Inherited
- What the daemon’s own environment holds, as far as the defaults care.
- Runner
Env - The parsed
runner.env: ordered, one entry per name.
Enums§
- Runner
EnvError - Why a
runner.envline or assignment was refused, or the file could not be read or written. No variant carries a value. - Runner
Platform - Which platform’s defaults to compute. A parameter rather than a
cfgso that every leg of CI tests every platform’s rules.
Constants§
- DIRECTORY_
VARIABLES - The
platform_defaultsthat name a directory the caller must create. Creating them creates the profile directory above them too. - MACOS_
DEFAULT_ LANG - The
LANGa macOS runner gets when the daemon has none. It is whatconfig.shwould have recorded from a default macOS terminal, and without a UTF-8 locale Ruby, CocoaPods and Python mis-handle non-ASCII text. - MACOS_
SYSTEM_ PATH - The
PATHlaunchd gives a service, kept behind Homebrew’s directories when the daemon has noPATHof its own. - MACOS_
TOOL_ DIRECTORIES - macOS directories put ahead of the inherited
PATH, when they exist and are not on it already: Apple Silicon Homebrew, then Intel Homebrew. - RESERVED_
NAMES - Names
runner.envmay not set, compared without regard to case: the temporary directory is per attempt, and cleanup and isolation rely on it. - RESERVED_
PREFIX - The prefix of every name
runner.envmay not set: the listener reads each such variable as a command-line input, including the JIT configuration that registers it. - RUNNER_
ENV_ FILE - The file’s name inside the configuration directory.
- RUNNER_
HOME_ DIR - The directory inside an attempt that is its runner’s profile on Windows.
- WINDOWS_
PROFILE_ VARIABLES - The variables
platform_defaultssets on Windows, in order: the profile directory twice, then its roaming and local application data.
Functions§
- path_in
- The
runner.envpath for a configuration directory. - platform_
defaults - The variables
platformsets for a runner whose attempt directory isruntime, beforerunner.envis applied. - runner_
environment - The variables a native runner starts with on top of the daemon’s
environment, in the order they must be applied: the platform defaults, then
file. Applied in order the last value for a name wins, as it does forCommand::env, sofileoverrides a default of the same name. - split_
assignment - Splits a
NAME=VALUEcommand-line argument.