This commit is contained in:
dahai 2026-11-14 05:42:52 +08:00 • committed by GitHub
commit 97d0643e8a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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';
}