You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Closes#20. Supersedes the reverted #18 / #19 / #21.
Implements the full Phase 4 bootstrap hardening from issue #10, with
the root-cause fix from #20 baked in. Key differences from the
earlier failed attempts:
## The fix for the actual failure
Previous attempts died at:
curl -fsSL <tarball>.sha256 | awk '{print }'
with a 404 (actions/runner doesn't publish per-tarball sidecar files,
empirically confirmed via aws ec2 get-console-output on a probe
instance — see #20).
This PR replaces that with a hardcoded table of expected hashes in
src/runner-checksums.js, keyed by 'arch-version'. Two x86_64 / arm64
entries for the currently-pinned v2.333.1, sourced from the release
body at github.com/actions/runner/releases/tag/v2.333.1. CI enforces
table-vs-upstream consistency on every PR (see pr.yml).
## Everything else from Phase 4
- Non-root 'runner' user (useradd -m, sudo -u runner -H bash heredoc).
RUNNER_ALLOW_RUNASROOT=1 escape hatch removed.
- New 'runner-version' input in action.yml (default '2.333.1'). To
override, add matching x64+arm64 SHAs to runner-checksums.js in
the same PR — verify-runner-url CI will reject the change if
the hashes don't match upstream.
- --ephemeral --unattended --disableupdate on config.sh. GitHub
auto-deregisters the runner after its job; disableupdate keeps
the binary stable during the short ephemeral session.
- set -euo pipefail on both the outer and inner (runner-user) shells.
The earlier fatal failure under set -e was the .sha256 404, which
no longer exists.
- Paramaterized RUNNER_VERSION / TARBALL / BASE bash vars.
## Tests
tests/runner-checksums.test.js — 6 new cases covering the table
shape, hex format, x64+arm64 parity per version, lookup returns for
known/unknown keys.
tests/config.test.js — 2 new cases for the runner-version input
(default fallback + override).
Total: 36 -> 44 tests.
## CI: verify-runner-url overhaul
The job now parses the runner-version from action.yml, then:
1. HEADs the Linux x64 release asset (unchanged).
2. Fetches the release body via 'gh api'.
3. Greps the BEGIN SHA linux-x64 / linux-arm64 HTML comments.
4. Cross-checks against the values lookup() returns from
src/runner-checksums.js.
Drift between the hardcoded table and upstream fails CI at code-
review time, not at runtime.
## Dogfood plan (MUCH more careful this time)
Provider SHA-pin rotation after merge, same pattern as prior phases.
This time I have full EC2 console-output diagnostic capability via
the recipe saved in my notes — any new bootstrap failure should be
trivially diagnosable rather than opaque.
Closing #20 on merge.
Signed-off-by: yuriyryabikov <22548029+kurok@users.noreply.github.com>
0 commit comments