fix: install pinned tools into a runner-writable path - #53
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Found by routing a real private-repository job to a self-hosted runner:
actionlint.ymlandosv-scan.ymlinstall 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
ghrunnerwrite access to/usr/local/binwould 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 toGITHUB_PATH:cpp-ci.ymlalso usessudo 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.