Skip to content

Commit

Permalink
Bring back tools folder fallback code (actions#232)
Browse files Browse the repository at this point in the history
  • Loading branch information
juliobbv authored Dec 17, 2019
1 parent 91b7e7a commit 50d979f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/Runner.Common/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
//
Expand Down
5 changes: 3 additions & 2 deletions src/Runner.Common/HostContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 50d979f

Please sign in to comment.