mirror of
https://github.com/actions/runner.git
synced 2025-12-25 02:47:19 +08:00
Adding a new vars context for non-secret variables (#2096)
* Adding a new vars context for non-secret variables * Fix test case * Trigger checks * Remove variables from env context and environment varibale * remove extra references * Add prefix handling to configuration variables * Fix test cases * Consume variables using vars in context data * removed action_yaml changes
This commit is contained in:
@@ -73,6 +73,7 @@ namespace GitHub.DistributedTask.Pipelines.ObjectTemplating
|
||||
public const String TimeoutMinutes = "timeout-minutes";
|
||||
public const String Username = "username";
|
||||
public const String Uses = "uses";
|
||||
public const String Vars = "vars";
|
||||
public const String VmImage = "vmImage";
|
||||
public const String Volumes = "volumes";
|
||||
public const String With = "with";
|
||||
|
||||
@@ -631,6 +631,7 @@ namespace GitHub.DistributedTask.Pipelines.ObjectTemplating
|
||||
{
|
||||
new NamedValueInfo<NoOperationNamedValue>(PipelineTemplateConstants.GitHub),
|
||||
new NamedValueInfo<NoOperationNamedValue>(PipelineTemplateConstants.Needs),
|
||||
new NamedValueInfo<NoOperationNamedValue>(PipelineTemplateConstants.Vars),
|
||||
};
|
||||
private static readonly INamedValueInfo[] s_stepNamedValues = new INamedValueInfo[]
|
||||
{
|
||||
@@ -643,6 +644,7 @@ namespace GitHub.DistributedTask.Pipelines.ObjectTemplating
|
||||
new NamedValueInfo<NoOperationNamedValue>(PipelineTemplateConstants.Runner),
|
||||
new NamedValueInfo<NoOperationNamedValue>(PipelineTemplateConstants.Env),
|
||||
new NamedValueInfo<NoOperationNamedValue>(PipelineTemplateConstants.Needs),
|
||||
new NamedValueInfo<NoOperationNamedValue>(PipelineTemplateConstants.Vars),
|
||||
};
|
||||
private static readonly IFunctionInfo[] s_stepConditionFunctions = new IFunctionInfo[]
|
||||
{
|
||||
|
||||
@@ -465,6 +465,7 @@ namespace GitHub.DistributedTask.Pipelines.ObjectTemplating
|
||||
PipelineTemplateConstants.Job,
|
||||
PipelineTemplateConstants.Runner,
|
||||
PipelineTemplateConstants.Env,
|
||||
PipelineTemplateConstants.Vars,
|
||||
};
|
||||
private readonly String[] s_expressionFunctionNames = new[]
|
||||
{
|
||||
|
||||
@@ -36,7 +36,8 @@
|
||||
"workflow-env": {
|
||||
"context": [
|
||||
"github",
|
||||
"secrets"
|
||||
"secrets",
|
||||
"vars"
|
||||
],
|
||||
"mapping": {
|
||||
"loose-key-type": "non-empty-string",
|
||||
@@ -86,6 +87,7 @@
|
||||
"context": [
|
||||
"github",
|
||||
"needs",
|
||||
"vars",
|
||||
"always(0,0)",
|
||||
"failure(0,MAX)",
|
||||
"cancelled(0,0)",
|
||||
@@ -98,6 +100,7 @@
|
||||
"context": [
|
||||
"github",
|
||||
"needs",
|
||||
"vars",
|
||||
"always(0,0)",
|
||||
"failure(0,MAX)",
|
||||
"cancelled(0,0)",
|
||||
@@ -116,7 +119,8 @@
|
||||
"strategy": {
|
||||
"context": [
|
||||
"github",
|
||||
"needs"
|
||||
"needs",
|
||||
"vars"
|
||||
],
|
||||
"mapping": {
|
||||
"properties": {
|
||||
@@ -156,7 +160,8 @@
|
||||
"github",
|
||||
"needs",
|
||||
"strategy",
|
||||
"matrix"
|
||||
"matrix",
|
||||
"vars"
|
||||
],
|
||||
"one-of": [
|
||||
"non-empty-string",
|
||||
@@ -182,7 +187,8 @@
|
||||
"needs",
|
||||
"strategy",
|
||||
"matrix",
|
||||
"secrets"
|
||||
"secrets",
|
||||
"vars"
|
||||
],
|
||||
"mapping": {
|
||||
"loose-key-type": "non-empty-string",
|
||||
@@ -204,7 +210,8 @@
|
||||
"strategy",
|
||||
"matrix",
|
||||
"needs",
|
||||
"env"
|
||||
"env",
|
||||
"vars"
|
||||
],
|
||||
"mapping": {
|
||||
"properties": {
|
||||
@@ -281,6 +288,7 @@
|
||||
"job",
|
||||
"runner",
|
||||
"env",
|
||||
"vars",
|
||||
"always(0,0)",
|
||||
"failure(0,0)",
|
||||
"cancelled(0,0)",
|
||||
@@ -299,6 +307,7 @@
|
||||
"job",
|
||||
"runner",
|
||||
"env",
|
||||
"vars",
|
||||
"always(0,0)",
|
||||
"failure(0,0)",
|
||||
"cancelled(0,0)",
|
||||
@@ -326,6 +335,7 @@
|
||||
"job",
|
||||
"runner",
|
||||
"env",
|
||||
"vars",
|
||||
"hashFiles(1,255)"
|
||||
],
|
||||
"mapping": {
|
||||
@@ -345,6 +355,7 @@
|
||||
"job",
|
||||
"runner",
|
||||
"env",
|
||||
"vars",
|
||||
"hashFiles(1,255)"
|
||||
],
|
||||
"mapping": {
|
||||
@@ -358,7 +369,8 @@
|
||||
"github",
|
||||
"needs",
|
||||
"strategy",
|
||||
"matrix"
|
||||
"matrix",
|
||||
"vars"
|
||||
],
|
||||
"one-of": [
|
||||
"string",
|
||||
@@ -384,7 +396,8 @@
|
||||
"github",
|
||||
"needs",
|
||||
"strategy",
|
||||
"matrix"
|
||||
"matrix",
|
||||
"vars"
|
||||
],
|
||||
"mapping": {
|
||||
"loose-key-type": "non-empty-string",
|
||||
@@ -397,7 +410,8 @@
|
||||
"github",
|
||||
"needs",
|
||||
"strategy",
|
||||
"matrix"
|
||||
"matrix",
|
||||
"vars"
|
||||
],
|
||||
"one-of": [
|
||||
"non-empty-string",
|
||||
@@ -409,7 +423,8 @@
|
||||
"context": [
|
||||
"secrets",
|
||||
"env",
|
||||
"github"
|
||||
"github",
|
||||
"vars"
|
||||
],
|
||||
"mapping": {
|
||||
"properties": {
|
||||
@@ -443,7 +458,8 @@
|
||||
"github",
|
||||
"needs",
|
||||
"strategy",
|
||||
"matrix"
|
||||
"matrix",
|
||||
"vars"
|
||||
],
|
||||
"boolean": {}
|
||||
},
|
||||
@@ -453,7 +469,8 @@
|
||||
"github",
|
||||
"needs",
|
||||
"strategy",
|
||||
"matrix"
|
||||
"matrix",
|
||||
"vars"
|
||||
],
|
||||
"number": {}
|
||||
},
|
||||
@@ -463,7 +480,8 @@
|
||||
"github",
|
||||
"needs",
|
||||
"strategy",
|
||||
"matrix"
|
||||
"matrix",
|
||||
"vars"
|
||||
],
|
||||
"string": {}
|
||||
},
|
||||
@@ -479,6 +497,7 @@
|
||||
"job",
|
||||
"runner",
|
||||
"env",
|
||||
"vars",
|
||||
"hashFiles(1,255)"
|
||||
],
|
||||
"boolean": {}
|
||||
@@ -495,6 +514,7 @@
|
||||
"job",
|
||||
"runner",
|
||||
"env",
|
||||
"vars",
|
||||
"hashFiles(1,255)"
|
||||
],
|
||||
"number": {}
|
||||
@@ -510,7 +530,8 @@
|
||||
"steps",
|
||||
"job",
|
||||
"runner",
|
||||
"env"
|
||||
"env",
|
||||
"vars"
|
||||
],
|
||||
"string": {}
|
||||
},
|
||||
@@ -524,7 +545,8 @@
|
||||
"steps",
|
||||
"job",
|
||||
"runner",
|
||||
"env"
|
||||
"env",
|
||||
"vars"
|
||||
],
|
||||
"string": {}
|
||||
},
|
||||
@@ -540,6 +562,7 @@
|
||||
"job",
|
||||
"runner",
|
||||
"env",
|
||||
"vars",
|
||||
"hashFiles(1,255)"
|
||||
],
|
||||
"string": {}
|
||||
|
||||
Reference in New Issue
Block a user