Resolve build errors

This commit is contained in:
Ethan Chiu
2020-06-15 09:12:54 -04:00
parent 885a128fa5
commit 85796d0011
3 changed files with 27 additions and 11 deletions

View File

@@ -61,7 +61,7 @@ namespace GitHub.Runner.Worker.Handlers
throw new InvalidOperationException($"Invalid action type {Action.Type} for {nameof(ScriptHandler)}"); throw new InvalidOperationException($"Invalid action type {Action.Type} for {nameof(ScriptHandler)}");
} }
ar multiLines = contents.Replace("\r\n", "\n").TrimEnd('\n').Split('\n'); var multiLines = contents.Replace("\r\n", "\n").TrimEnd('\n').Split('\n');
foreach (var line in multiLines) foreach (var line in multiLines)
{ {
// Bright Cyan color // Bright Cyan color
@@ -228,6 +228,23 @@ namespace GitHub.Runner.Worker.Handlers
var contents = runValue ?? string.Empty; var contents = runValue ?? string.Empty;
string workingDirectory = null;
if (!Inputs.TryGetValue("workingDirectory", out workingDirectory))
{
// TODO: figure out how defaults interact with template later
// for now, we won't check job.defaults if we are inside a template.
if (string.IsNullOrEmpty(ExecutionContext.ScopeName) && ExecutionContext.JobDefaults.TryGetValue("run", out var runDefaults))
{
if (runDefaults.TryGetValue("working-directory", out workingDirectory))
{
ExecutionContext.Debug("Overwrite 'working-directory' base on job defaults.");
}
}
}
var workspaceDir = githubContext["workspace"] as StringContextData;
workingDirectory = Path.Combine(workspaceDir, workingDirectory ?? string.Empty);
string shell = null; string shell = null;
if (!Inputs.TryGetValue("shell", out shell) || string.IsNullOrEmpty(shell)) if (!Inputs.TryGetValue("shell", out shell) || string.IsNullOrEmpty(shell))
{ {
@@ -363,4 +380,3 @@ namespace GitHub.Runner.Worker.Handlers
} }
} }
}

View File

@@ -70,9 +70,9 @@ namespace GitHub.Runner.Worker.Handlers
{ {
// TODO // TODO
// Runner plugin // Runner plugin
handler = HostContext.CreateService<ICompositeHandler>(); handler = HostContext.CreateService<ICompositeActionHandler>();
// handler = CompositeHandler; // handler = CompositeHandler;
(handler as ICompositeHandler).Data = data as CompositeActionExecutionData; (handler as ICompositeActionHandler).Data = data as CompositeActionExecutionData;
} }
else else
{ {

View File

@@ -289,8 +289,8 @@ namespace GitHub.Runner.Worker
// TODO: Maybe add EvaluateStep stuff here too? // TODO: Maybe add EvaluateStep stuff here too?
// TODO: INSERT CONVERTSTEPS FUNCTION HERE FOR EVALUATING STEPS // TODO: INSERT CONVERTSTEPS FUNCTION HERE FOR EVALUATING STEPS
// Maybe we don't need to do this here do we need to initialize the job? // Maybe we don't need to do this here do we need to initialize the job?
context.Debug("Evaluating job evaluating steps"); // context.Debug("Evaluating job evaluating steps");
var stepsEvaluation = templateEvaluator.EvaluateSteps(contextData, context, context.ExpressionFunctions); // var stepsEvaluation = templateEvaluator.EvaluateSteps(contextData, context, context.ExpressionFunctions);
//////// ////////
} }