Environment variables
env_vars sets variables for every job on the runner — build flags, cache
directories, registry hosts.
A name starting with
GITHUB_, RUNNER_ or ACTIONS_ is refused on purpose:
a config file must not be able to change how the runner talks to GitHub.
Cloud identity
By default a runner has no cloud identity. Nothing in a job can mint a credential from the metadata service, which is what you want for the great majority of jobs.- AWS
- Google Cloud
- Azure
iam:PassRole for that role, scoped to it —
the statement is here.Provisioning from your image
By default the boot script travels in the machine’s launch metadata. If you would rather it did not,provision_via: pull_from_api launches the machine
with no user data at all, and your image fetches the script itself:
Name tag. The script is handed out
once per runner, so a second request gets nothing.
Neither is strictly safer; they move the exposure. Security
states both plainly. Most people should leave the default alone.
What the machine does at boot
Knowing the order helps when you are debugging an image:1
Schedule its own shutdown
Before anything else, so a machine whose script later fails still goes
away.
2
Write a one-boot marker
A rebooted machine powers off rather than registering twice.
3
Find or install actions/runner
/opt/actions-runner with a matching .version file is used as-is.
Otherwise it is downloaded and its dependencies installed.4
Apply env_vars, and the GPU driver if needed
Into the runner’s own environment file, so every step sees them.
5
Start the cache proxy, if cache is on
And trust its local certificate authority. Caching
6
Register and run one job
Then power off, whatever the outcome.
/var/log/cloud-init-output.log, and the cache
proxy’s own log at /var/log/airship-cacheproxy.log.