Skip to content

fix: install pinned tools into a runner-writable path - #53

Merged
rldyourmnd merged 2 commits into
mainfrom
fix/self-hosted-compatible-tool-install
Aug 1, 2026
Merged

fix: install pinned tools into a runner-writable path#53
rldyourmnd merged 2 commits into
mainfrom
fix/self-hosted-compatible-tool-install

Conversation

@rldyourmnd

Copy link
Copy Markdown
Contributor

Found by routing a real private-repository job to a self-hosted runner:

install: cannot create regular file '/usr/local/bin/actionlint': Permission denied

actionlint.yml and osv-scan.yml install their checksum-verified binaries into /usr/local/bin. That succeeds on GitHub-hosted runners, where the job user can write there, and fails on any self-hosted runner whose account is unprivileged.

The privilege is not incidental. A self-hosted runner that can write to system paths is a worse runner — every job then shares mutable system state. Granting ghrunner write access to /usr/local/bin would trade the isolation for a one-line convenience, so the fix belongs in the library.

Both steps now install into "${RUNNER_TEMP}/bin" and prepend it to GITHUB_PATH:

  • writable on hosted and self-hosted runners
  • torn down with the job, so nothing leaks between runs
  • checksum verification unchanged — only the destination moves

cpp-ci.yml also uses sudo apt-get; that is a different class (system packages, not a single pinned binary) and is left alone — it simply cannot run on an unprivileged self-hosted runner and should stay on hosted runners.

validate_all.py: 18/18 OK.

actionlint.yml and osv-scan.yml installed their checksum-verified binaries into
/usr/local/bin. That works on GitHub-hosted runners, where the job user can
write there, and fails on a self-hosted runner whose account is unprivileged:

    install: cannot create regular file '/usr/local/bin/actionlint': Permission denied

Observed on a real private-repo job after routing it to a self-hosted runner.
The privilege is not incidental - a self-hosted runner that CAN write to system
paths is a worse runner, because every job then shares a mutable system state.
So the fix belongs here, not in the runner's permissions.

Both now install into "${RUNNER_TEMP}/bin" and prepend it to GITHUB_PATH, which
is writable on hosted and self-hosted alike and is torn down with the job.
Checksum verification is unchanged; only the destination moves.

validate_all.py: 18/18 OK.
…l fix

The proven_digest deliberately invalidates on any edit to the workflow, so the
runtime-proven status had to be re-earned rather than carried over. Re-proved by
the actionlint job on this pull request, which exercises the new
RUNNER_TEMP/bin install path on a GitHub-hosted runner.

osv-scan.yml needs no update: it is recorded as unverified and carries no
proven_digest.
@rldyourmnd
rldyourmnd merged commit c1466df into main Aug 1, 2026
11 checks passed
@rldyourmnd
rldyourmnd deleted the fix/self-hosted-compatible-tool-install branch August 1, 2026 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant