Repository navigation
Conversation
…unners On macOS the action unconditionally overwrites AGENT_TOOLSDIRECTORY with the hosted-images default /Users/runner/hostedtoolcache. Self-hosted macOS runners export their own AGENT_TOOLSDIRECTORY (and RUNNER_TOOL_CACHE) in the runner service environment, but the hardcode discards both, so the downloaded setup.sh attempts mkdir /Users/runner/hostedtoolcache and fails with 'Permission denied' on hosts without a 'runner' user account. Only fall back to the hosted default when the runner did not provide a non-empty AGENT_TOOLSDIRECTORY. Fixes actions#914 (macOS variant) Co-Authored-By: Claude Code <noreply@anthropic.com>
This branch has not been deployed
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.
Summary
On macOS the action unconditionally overwrites
AGENT_TOOLSDIRECTORYwith the hosted-images default/Users/runner/hostedtoolcache:src/setup-python.ts:Self-hosted macOS runners export their own
AGENT_TOOLSDIRECTORY/RUNNER_TOOL_CACHEin the runner service environment. The hardcode discards both, so the downloadedsetup.shrunsmkdir -p /Users/runner/hostedtoolcacheand fails withmkdir: /Users/runner: Permission deniedon hosts that have norunneruser account.Reproduction
Self-hosted macOS runner with
RUNNER_TOOL_CACHE/AGENT_TOOLSDIRECTORYexported via the service wrapper (verified present in both bash and node step env), anyactions/setup-python@v7step that needs to download a Python version fails at the archive's install script:Change
Fall back to
/Users/runner/hostedtoolcacheonly when the runner did not provide a non-emptyAGENT_TOOLSDIRECTORY. Behavior on GitHub-hosted macOS images is unchanged (they setAGENT_TOOLSDIRECTORY=/Users/runner/hostedtoolcacheexplicitly or the fallback applies identically).Validation
RUNNER_TOOL_CACHE/AGENT_TOOLSDIRECTORYpointing to a writable custom dir: previously everysetup-pythonstep failed with the mkdir error above; with the patched action logic the same step resolves the install dir from the runner-provided path.AGENT_TOOLSDIRECTORYis either pre-set by the image (unchanged) or the fallback applies (identical to current behavior).Fixes #914 (macOS variant; the Linux
/opt/hostedtoolcachesymptom reported there has a separate code path)🤖 Generated with Claude Code