mirror of
https://github.com/actions/runner.git
synced 2025-12-18 08:17:02 +00:00
Fix env format
This commit is contained in:
@@ -75,6 +75,8 @@ namespace GitHub.Runner.Worker
|
|||||||
}
|
}
|
||||||
|
|
||||||
var actionMapping = token.AssertMapping("action manifest root");
|
var actionMapping = token.AssertMapping("action manifest root");
|
||||||
|
var envComposite = default(MappingToken);
|
||||||
|
|
||||||
foreach (var actionPair in actionMapping)
|
foreach (var actionPair in actionMapping)
|
||||||
{
|
{
|
||||||
var propertyName = actionPair.Key.AssertString($"action.yml property key");
|
var propertyName = actionPair.Key.AssertString($"action.yml property key");
|
||||||
@@ -93,9 +95,14 @@ namespace GitHub.Runner.Worker
|
|||||||
ConvertInputs(context, actionPair.Value, actionDefinition);
|
ConvertInputs(context, actionPair.Value, actionDefinition);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "runs":
|
case "env":
|
||||||
actionDefinition.Execution = ConvertRuns(executionContext, context, actionPair.Value);
|
envComposite = actionPair.Value.AssertMapping("env");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case "runs":
|
||||||
|
actionDefinition.Execution = ConvertRuns(executionContext, context, actionPair.Value, envComposite);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
Trace.Info($"Ignore action property {propertyName}.");
|
Trace.Info($"Ignore action property {propertyName}.");
|
||||||
break;
|
break;
|
||||||
@@ -340,7 +347,8 @@ namespace GitHub.Runner.Worker
|
|||||||
private ActionExecutionData ConvertRuns(
|
private ActionExecutionData ConvertRuns(
|
||||||
IExecutionContext executionContext,
|
IExecutionContext executionContext,
|
||||||
TemplateContext context,
|
TemplateContext context,
|
||||||
TemplateToken inputsToken)
|
TemplateToken inputsToken,
|
||||||
|
MappingToken envComposite)
|
||||||
{
|
{
|
||||||
var runsMapping = inputsToken.AssertMapping("runs");
|
var runsMapping = inputsToken.AssertMapping("runs");
|
||||||
var usingToken = default(StringToken);
|
var usingToken = default(StringToken);
|
||||||
@@ -469,10 +477,15 @@ namespace GitHub.Runner.Worker
|
|||||||
return new CompositeActionExecutionData()
|
return new CompositeActionExecutionData()
|
||||||
{
|
{
|
||||||
Steps = stepsLoaded,
|
Steps = stepsLoaded,
|
||||||
Environment = envToken
|
Environment = envComposite
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// If there is an env set and it's not for composite action, yield an error
|
||||||
|
if (envComposite != null && string.IsNullOrEmpty(Environment.GetEnvironmentVariable("TESTING_COMPOSITE_ACTIONS_ALPHA")))
|
||||||
|
{
|
||||||
|
throw new ArgumentException("You cannot use env unless you are using Composite Actions");
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
throw new ArgumentOutOfRangeException($"'using: {usingToken.Value}' is not supported, use 'docker' or 'node12' instead.");
|
throw new ArgumentOutOfRangeException($"'using: {usingToken.Value}' is not supported, use 'docker' or 'node12' instead.");
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
"name": "string",
|
"name": "string",
|
||||||
"description": "string",
|
"description": "string",
|
||||||
"inputs": "inputs",
|
"inputs": "inputs",
|
||||||
|
"env": "runs-env",
|
||||||
"runs": "runs"
|
"runs": "runs"
|
||||||
},
|
},
|
||||||
"loose-key-type": "non-empty-string",
|
"loose-key-type": "non-empty-string",
|
||||||
@@ -88,7 +89,6 @@
|
|||||||
"mapping": {
|
"mapping": {
|
||||||
"properties": {
|
"properties": {
|
||||||
"using": "non-empty-string",
|
"using": "non-empty-string",
|
||||||
"env": "runs-env",
|
|
||||||
"steps": "composite-steps"
|
"steps": "composite-steps"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user