Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/setup-python.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,12 @@ function resolveVersionInput() {
}

async function run() {
if (IS_MAC) {
if (IS_MAC && !process.env.AGENT_TOOLSDIRECTORY?.trim()) {
// Default to the hosted-images location only when the runner did not
// provide one. Self-hosted macOS runners export their own
// AGENT_TOOLSDIRECTORY; overwriting it unconditionally makes the action
// mkdir /Users/runner/hostedtoolcache, which fails on hosts where the
// `runner` user does not exist (#914).
process.env['AGENT_TOOLSDIRECTORY'] = '/Users/runner/hostedtoolcache';
}

Expand Down