mirror of
https://github.com/actions/runner.git
synced 2025-12-10 04:06:57 +00:00
Compare commits
9 Commits
v2.318.0
...
testingScr
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
76bf461032 | ||
|
|
48ea146797 | ||
|
|
4dea9dc1c9 | ||
|
|
1ad181673f | ||
|
|
4cf17bc51e | ||
|
|
fd75cdb8ab | ||
|
|
3393f3991c | ||
|
|
faf826d15a | ||
|
|
43610319c4 |
@@ -395,7 +395,7 @@ namespace GitHub.Runner.Worker
|
|||||||
Trace.Info($"Action cleanup plugin: {plugin.PluginTypeName}.");
|
Trace.Info($"Action cleanup plugin: {plugin.PluginTypeName}.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (definition.Data.Execution.ExecutionType == ActionExecutionType.Composite && !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("TESTING_COMPOSITE_ACTIONS_ALPHA")))
|
else if (definition.Data.Execution.ExecutionType == ActionExecutionType.Composite)
|
||||||
{
|
{
|
||||||
var compositeAction = definition.Data.Execution as CompositeActionExecutionData;
|
var compositeAction = definition.Data.Execution as CompositeActionExecutionData;
|
||||||
Trace.Info($"Load {compositeAction.Steps?.Count ?? 0} action steps.");
|
Trace.Info($"Load {compositeAction.Steps?.Count ?? 0} action steps.");
|
||||||
@@ -1048,7 +1048,7 @@ namespace GitHub.Runner.Worker
|
|||||||
Trace.Info($"Action plugin: {(actionDefinitionData.Execution as PluginActionExecutionData).Plugin}, no more preparation.");
|
Trace.Info($"Action plugin: {(actionDefinitionData.Execution as PluginActionExecutionData).Plugin}, no more preparation.");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
else if (actionDefinitionData.Execution.ExecutionType == ActionExecutionType.Composite && !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("TESTING_COMPOSITE_ACTIONS_ALPHA")))
|
else if (actionDefinitionData.Execution.ExecutionType == ActionExecutionType.Composite)
|
||||||
{
|
{
|
||||||
Trace.Info($"Action composite: {(actionDefinitionData.Execution as CompositeActionExecutionData).Steps}, no more preparation.");
|
Trace.Info($"Action composite: {(actionDefinitionData.Execution as CompositeActionExecutionData).Steps}, no more preparation.");
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -105,12 +105,7 @@ namespace GitHub.Runner.Worker
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case "outputs":
|
case "outputs":
|
||||||
if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("TESTING_COMPOSITE_ACTIONS_ALPHA")))
|
actionOutputs = actionPair.Value.AssertMapping("outputs");
|
||||||
{
|
|
||||||
actionOutputs = actionPair.Value.AssertMapping("outputs");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
Trace.Info($"Ignore action property outputs. Outputs for a whole action is not supported yet.");
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "description":
|
case "description":
|
||||||
@@ -423,14 +418,10 @@ namespace GitHub.Runner.Worker
|
|||||||
preIfToken = run.Value.AssertString("pre-if");
|
preIfToken = run.Value.AssertString("pre-if");
|
||||||
break;
|
break;
|
||||||
case "steps":
|
case "steps":
|
||||||
if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("TESTING_COMPOSITE_ACTIONS_ALPHA")))
|
var stepsToken = run.Value.AssertSequence("steps");
|
||||||
{
|
steps = PipelineTemplateConverter.ConvertToSteps(templateContext, stepsToken);
|
||||||
var stepsToken = run.Value.AssertSequence("steps");
|
templateContext.Errors.Check();
|
||||||
steps = PipelineTemplateConverter.ConvertToSteps(templateContext, stepsToken);
|
break;
|
||||||
templateContext.Errors.Check();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
throw new Exception("You aren't supposed to be using Composite Actions yet!");
|
|
||||||
default:
|
default:
|
||||||
Trace.Info($"Ignore run property {runsKey}.");
|
Trace.Info($"Ignore run property {runsKey}.");
|
||||||
break;
|
break;
|
||||||
@@ -478,7 +469,7 @@ namespace GitHub.Runner.Worker
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (string.Equals(usingToken.Value, "composite", StringComparison.OrdinalIgnoreCase) && !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("TESTING_COMPOSITE_ACTIONS_ALPHA")))
|
else if (string.Equals(usingToken.Value, "composite", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
if (steps == null)
|
if (steps == null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ namespace GitHub.Runner.Worker
|
|||||||
private readonly HashSet<string> _contextEnvWhitelist = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
|
private readonly HashSet<string> _contextEnvWhitelist = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
|
||||||
{
|
{
|
||||||
"action",
|
"action",
|
||||||
|
"action_path",
|
||||||
"actor",
|
"actor",
|
||||||
"api_url",
|
"api_url",
|
||||||
"base_ref",
|
"base_ref",
|
||||||
|
|||||||
@@ -56,6 +56,14 @@ namespace GitHub.Runner.Worker.Handlers
|
|||||||
childScopeName = $"__{Guid.NewGuid()}";
|
childScopeName = $"__{Guid.NewGuid()}";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Copy the github context so that we don't modify the original pointer
|
||||||
|
// We can't use PipelineContextData.Clone() since that creates a null pointer exception for copying a GitHubContext
|
||||||
|
var compositeGitHubContext = new GitHubContext();
|
||||||
|
foreach (var pair in githubContext)
|
||||||
|
{
|
||||||
|
compositeGitHubContext[pair.Key] = pair.Value;
|
||||||
|
}
|
||||||
|
|
||||||
foreach (Pipelines.ActionStep actionStep in actionSteps)
|
foreach (Pipelines.ActionStep actionStep in actionSteps)
|
||||||
{
|
{
|
||||||
var actionRunner = HostContext.CreateService<IActionRunner>();
|
var actionRunner = HostContext.CreateService<IActionRunner>();
|
||||||
@@ -64,6 +72,11 @@ namespace GitHub.Runner.Worker.Handlers
|
|||||||
actionRunner.Condition = actionStep.Condition;
|
actionRunner.Condition = actionStep.Condition;
|
||||||
|
|
||||||
var step = ExecutionContext.CreateCompositeStep(childScopeName, actionRunner, inputsData, Environment);
|
var step = ExecutionContext.CreateCompositeStep(childScopeName, actionRunner, inputsData, Environment);
|
||||||
|
|
||||||
|
// Set GITHUB_ACTION_PATH
|
||||||
|
step.ExecutionContext.ExpressionValues["github"] = compositeGitHubContext;
|
||||||
|
step.ExecutionContext.SetGitHubContext("action_path", ActionDirectory);
|
||||||
|
|
||||||
compositeSteps.Add(step);
|
compositeSteps.Add(step);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -176,9 +189,6 @@ namespace GitHub.Runner.Worker.Handlers
|
|||||||
|
|
||||||
var actionStep = step as IActionRunner;
|
var actionStep = step as IActionRunner;
|
||||||
|
|
||||||
// Set GITHUB_ACTION
|
|
||||||
step.ExecutionContext.SetGitHubContext("action", step.ExecutionContext.GetFullyQualifiedContextName());
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// Evaluate and merge action's env block to env context
|
// Evaluate and merge action's env block to env context
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
2.267.0
|
2.272.0
|
||||||
|
|||||||
Reference in New Issue
Block a user