@@ -10,7 +10,10 @@ const IGNORED_TASK_DEFINITION_ATTRIBUTES = [
10
10
'taskDefinitionArn' ,
11
11
'requiresAttributes' ,
12
12
'revision' ,
13
- 'status'
13
+ 'status' ,
14
+ 'registeredAt' ,
15
+ 'deregisteredAt' ,
16
+ 'registeredBy'
14
17
] ;
15
18
16
19
const WAIT_DEFAULT_DELAY_SEC = 5 ;
@@ -76,6 +79,36 @@ function removeIgnoredAttributes(taskDef) {
76
79
return taskDef ;
77
80
}
78
81
82
+ function maintainValidObjects ( taskDef ) {
83
+ if ( validateProxyConfigurations ( taskDef ) ) {
84
+ taskDef . proxyConfiguration . properties . forEach ( ( property , index , arr ) => {
85
+ if ( ! ( 'value' in property ) ) {
86
+ arr [ index ] . value = '' ;
87
+ }
88
+ if ( ! ( 'name' in property ) ) {
89
+ arr [ index ] . name = '' ;
90
+ }
91
+ } ) ;
92
+ }
93
+
94
+ if ( taskDef && taskDef . containerDefinitions ) {
95
+ taskDef . containerDefinitions . forEach ( ( container ) => {
96
+ if ( container . environment ) {
97
+ container . environment . forEach ( ( property , index , arr ) => {
98
+ if ( ! ( 'value' in property ) ) {
99
+ arr [ index ] . value = '' ;
100
+ }
101
+ } ) ;
102
+ }
103
+ } ) ;
104
+ }
105
+ return taskDef ;
106
+ }
107
+
108
+ function validateProxyConfigurations ( taskDef ) {
109
+ return 'proxyConfiguration' in taskDef && taskDef . proxyConfiguration . type && taskDef . proxyConfiguration . type == 'APPMESH' && taskDef . proxyConfiguration . properties && taskDef . proxyConfiguration . properties . length > 0 ;
110
+ }
111
+
79
112
async function run ( ) {
80
113
try {
81
114
const agent = 'amazon-ecs-run-task-for-github-actions'
@@ -101,7 +134,7 @@ async function run() {
101
134
taskDefinitionFile :
102
135
path . join ( process . env . GITHUB_WORKSPACE , taskDefinitionFile ) ;
103
136
const fileContents = fs . readFileSync ( taskDefPath , 'utf8' ) ;
104
- const taskDefContents = removeIgnoredAttributes ( cleanNullKeys ( yaml . parse ( fileContents ) ) ) ;
137
+ const taskDefContents = maintainValidObjects ( removeIgnoredAttributes ( cleanNullKeys ( yaml . parse ( fileContents ) ) ) ) ;
105
138
106
139
let registerResponse ;
107
140
try {
0 commit comments