mirror of
				https://kkgithub.com/actions/setup-python.git
				synced 2025-10-31 10:41:52 +08:00 
			
		
		
		
	fix: Self-Hosted Tool Cache
This fixes the tool cache path for self-hosted runners, along
with handling AGENT_TOOLSDIRECTORY for both hosted + self-hosted.
    Fixes actions#459
			
			
This commit is contained in:
		
							
								
								
									
										10
									
								
								dist/setup/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										10
									
								
								dist/setup/index.js
									
									
									
									
										vendored
									
									
								
							| @ -65340,13 +65340,9 @@ function resolveVersionInput() { | ||||
| function run() { | ||||
|     var _a; | ||||
|     return __awaiter(this, void 0, void 0, function* () { | ||||
|         // According to the README windows binaries do not require to be installed
 | ||||
|         // in the specific location, but Mac and Linux do
 | ||||
|         if (!utils_1.IS_WINDOWS && !((_a = process.env.AGENT_TOOLSDIRECTORY) === null || _a === void 0 ? void 0 : _a.trim())) { | ||||
|             if (utils_1.IS_LINUX) | ||||
|                 process.env['AGENT_TOOLSDIRECTORY'] = '/opt/hostedtoolcache'; | ||||
|             else | ||||
|                 process.env['AGENT_TOOLSDIRECTORY'] = '/Users/runner/hostedtoolcache'; | ||||
|         // When setting AGENT_TOOLSDIRECTORY, the actions/tool-cache function find
 | ||||
|         // is not able to find the files cached by actions/python-version.
 | ||||
|         if ((_a = process.env.AGENT_TOOLSDIRECTORY) === null || _a === void 0 ? void 0 : _a.trim()) { | ||||
|             process.env['RUNNER_TOOL_CACHE'] = process.env['AGENT_TOOLSDIRECTORY']; | ||||
|         } | ||||
|         core.debug(`Python is expected to be installed into RUNNER_TOOL_CACHE=${process.env['RUNNER_TOOL_CACHE']}`); | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Leon Wright
					Leon Wright