diff --git a/src/Runner.Common/Constants.cs b/src/Runner.Common/Constants.cs index e0781c21f24..c2d7d53965f 100644 --- a/src/Runner.Common/Constants.cs +++ b/src/Runner.Common/Constants.cs @@ -189,6 +189,11 @@ public static class Actions public static readonly string StepDebug = "ACTIONS_STEP_DEBUG"; } + public static class Agent + { + public static readonly string ToolsDirectory = "agent.ToolsDirectory"; + } + public static class System { // diff --git a/src/Runner.Common/HostContext.cs b/src/Runner.Common/HostContext.cs index 791966c0f04..f110bbd40a1 100644 --- a/src/Runner.Common/HostContext.cs +++ b/src/Runner.Common/HostContext.cs @@ -229,8 +229,9 @@ public string GetDirectory(WellKnownDirectory directory) break; 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)) { path = Path.Combine(