mirror of
https://github.com/actions/runner.git
synced 2025-12-11 12:57:05 +00:00
Add comments + fix action_yaml schema
This commit is contained in:
@@ -17,5 +17,58 @@ namespace GitHub.Runner.Worker.Handlers
|
||||
}
|
||||
|
||||
// TODO: IMPLEMENT LOGIC FOR HANDLER CODE
|
||||
|
||||
public sealed class CompositeActionHandler : Handler, ICompositeActionHandler
|
||||
{
|
||||
public CompositeActionExecutionData Data { get; set; }
|
||||
|
||||
public async Task RunAsync(ActionRunStage stage)
|
||||
{
|
||||
// Copied from NodEscriptActionHandler.cs
|
||||
// Validate args.
|
||||
Trace.Entering();
|
||||
ArgUtil.NotNull(Data, nameof(Data));
|
||||
ArgUtil.NotNull(ExecutionContext, nameof(ExecutionContext));
|
||||
ArgUtil.NotNull(Inputs, nameof(Inputs));
|
||||
ArgUtil.Directory(ActionDirectory, nameof(ActionDirectory));
|
||||
|
||||
// Update the env dictionary.
|
||||
AddInputsToEnvironment();
|
||||
AddPrependPathToEnvironment();
|
||||
|
||||
// expose context to environment
|
||||
// for example, this is how we know what OS the runner is running on
|
||||
foreach (var context in ExecutionContext.ExpressionValues)
|
||||
{
|
||||
if (context.Value is IEnvironmentContextData runtimeContext && runtimeContext != null)
|
||||
{
|
||||
foreach (var env in runtimeContext.GetRuntimeEnvironmentVariables())
|
||||
{
|
||||
Environment[env.Key] = env.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Add Actions Runtime server info
|
||||
var systemConnection = ExecutionContext.Endpoints.Single(x => string.Equals(x.Name, WellKnownServiceEndpointNames.SystemVssConnection, StringComparison.OrdinalIgnoreCase));
|
||||
Environment["ACTIONS_RUNTIME_URL"] = systemConnection.Url.AbsoluteUri;
|
||||
Environment["ACTIONS_RUNTIME_TOKEN"] = systemConnection.Authorization.Parameters[EndpointAuthorizationParameters.AccessToken];
|
||||
if (systemConnection.Data.TryGetValue("CacheServerUrl", out var cacheUrl) && !string.IsNullOrEmpty(cacheUrl))
|
||||
{
|
||||
Environment["ACTIONS_CACHE_URL"] = cacheUrl;
|
||||
}
|
||||
|
||||
// Resolve steps
|
||||
// How do I handle the MappingToken?
|
||||
MappingToken target = null;
|
||||
if (stage == ActionRunStage.Main)
|
||||
{
|
||||
target = Data.Steps;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user