Env Flow => Able to get env variables and overwrite current env variables => but it doesn't 'stick'

This commit is contained in:
Ethan Chiu
2020-06-18 15:34:48 -04:00
parent 038e5e2c2e
commit e56b2439b9
7 changed files with 111 additions and 3 deletions

View File

@@ -105,8 +105,9 @@ namespace GitHub.Runner.Worker
// others
void ForceTaskComplete();
void RegisterPostJobStep(IStep step);
IStep RegisterCompositeStep(IStep step, DictionaryContextData inputsData);
IStep RegisterCompositeStep(IStep step, DictionaryContextData inputsData, PipelineContextData envData);
void EnqueueAllCompositeSteps(Queue<IStep> steps);
ExecutionContext getParentExecutionContext();
}
public sealed class ExecutionContext : RunnerService, IExecutionContext
@@ -271,7 +272,7 @@ namespace GitHub.Runner.Worker
RegisterCompositeStep is a helper function used in CompositeActionHandler::RunAsync to
add a child node, aka a step, to the current job to the front of the queue for processing.
*/
public IStep RegisterCompositeStep(IStep step, DictionaryContextData inputsData)
public IStep RegisterCompositeStep(IStep step, DictionaryContextData inputsData, PipelineContextData envData)
{
// ~Brute Force Method~
// There is no way to put this current job in front of the queue in < O(n) time where n = # of elements in JobSteps
@@ -296,6 +297,10 @@ namespace GitHub.Runner.Worker
var newGuid = Guid.NewGuid();
step.ExecutionContext = Root.CreateChild(newGuid, step.DisplayName, newGuid.ToString("N"), null, null);
step.ExecutionContext.ExpressionValues["inputs"] = inputsData;
step.ExecutionContext.ExpressionValues["env"] = envData;
// TODO add environment variables for individual composite action steps
return step;
}
@@ -329,6 +334,11 @@ namespace GitHub.Runner.Worker
}
}
public ExecutionContext getParentExecutionContext()
{
return _parentExecutionContext;
}
public IExecutionContext CreateChild(Guid recordId, string displayName, string refName, string scopeName, string contextName, Dictionary<string, string> intraActionState = null, int? recordOrder = null)
{
Trace.Entering();