File tree Expand file tree Collapse file tree 3 files changed +52
-7
lines changed
vsts-variable-transform/v3 Expand file tree Collapse file tree 3 files changed +52
-7
lines changed Original file line number Diff line number Diff line change 6060 "options" : {
6161 "value" : " value" ,
6262 "env" : " env"
63- },
64- "aliases" : [" variableName" ]
63+ }
6564 },
6665 {
6766 "defaultValue" : " " ,
Original file line number Diff line number Diff line change 3434 }
3535 ],
3636 "inputs" : [
37+ {
38+ "defaultValue" : " value" ,
39+ "helpMarkdown" : " Take the value from the input or an environment variable." ,
40+ "label" : " From" ,
41+ "name" : " From" ,
42+ "required" : true ,
43+ "type" : " pickList" ,
44+ "options" : {
45+ "value" : " value" ,
46+ "env" : " env"
47+ }
48+ },
3749 {
3850 "defaultValue" : " " ,
39- "helpMarkdown" : " Input value. You can use other variables as input as with any other text input using the `$(...)` notation anywhere in the value ." ,
40- "label" : " Input Value" ,
41- "name" : " value " ,
51+ "helpMarkdown" : " The value to assign to the variable ." ,
52+ "label" : " Value" ,
53+ "name" : " Value " ,
4254 "required" : false ,
43- "type" : " string"
55+ "type" : " string" ,
56+ "aliases" : [" value" ],
57+ "visibleRule" : " From=value"
58+ },
59+ {
60+ "defaultValue" : " " ,
61+ "helpMarkdown" : " The value to assign to the variable." ,
62+ "label" : " Environment Variable" ,
63+ "name" : " Env" ,
64+ "required" : true ,
65+ "type" : " string" ,
66+ "aliases" : [" Env" , " Environment" ],
67+ "visibleRule" : " From=env"
4468 },
4569 {
4670 "defaultValue" : " " ,
Original file line number Diff line number Diff line change 11import * as tl from "azure-pipelines-task-lib/task" ;
22
33const transformAction = tl . getInput ( "transformAction" , false ) || "none" ;
4- let value = tl . getInput ( "value" ) || "" ;
4+
5+ function getValue ( )
6+ {
7+ const from = tl . getInput ( "From" ) || "value" ;
8+ switch ( from )
9+ {
10+ case "value" :
11+ {
12+ return tl . getInput ( "Value" ) ;
13+ }
14+ case "env" :
15+ {
16+ return process . env [ tl . getInput ( "Env" , true ) ] ;
17+ }
18+ default :
19+ {
20+ return "" ;
21+ }
22+ }
23+ }
24+
25+ let value = getValue ( ) || "" ;
26+
527const isSecret = tl . getBoolInput ( "isSecret" ) || false ;
628const useTaskLib = tl . getBoolInput ( "useTasklib" ) || false ;
729const variable = tl . getInput ( "variableName" , true ) ;
You can’t perform that action at this time.
0 commit comments