Bring back tools folder fallback code (#232)

This commit is contained in:
Julio Barba
2019-12-17 18:21:13 -05:00
committed by GitHub
parent 91b7e7a07a
commit 50d979f1b2
2 changed files with 8 additions and 2 deletions

View File

@@ -189,6 +189,11 @@ namespace GitHub.Runner.Common
public static readonly string StepDebug = "ACTIONS_STEP_DEBUG"; public static readonly string StepDebug = "ACTIONS_STEP_DEBUG";
} }
public static class Agent
{
public static readonly string ToolsDirectory = "agent.ToolsDirectory";
}
public static class System public static class System
{ {
// //

View File

@@ -229,8 +229,9 @@ namespace GitHub.Runner.Common
break; break;
case WellKnownDirectory.Tools: case WellKnownDirectory.Tools:
path = Environment.GetEnvironmentVariable("RUNNER_TOOL_CACHE"); // TODO: Coallesce to just check RUNNER_TOOL_CACHE when images stabilize
path = Environment.GetEnvironmentVariable("RUNNER_TOOL_CACHE") ?? Environment.GetEnvironmentVariable("RUNNER_TOOLSDIRECTORY") ?? Environment.GetEnvironmentVariable("AGENT_TOOLSDIRECTORY") ?? Environment.GetEnvironmentVariable(Constants.Variables.Agent.ToolsDirectory);
if (string.IsNullOrEmpty(path)) if (string.IsNullOrEmpty(path))
{ {
path = Path.Combine( path = Path.Combine(