@@ -55,7 +55,7 @@ async function runTask(ecs, clusterName, taskDefArn, waitForMinutes, enableECSMa
55
55
if(assignPublicIP != "" && (subnetIds != "" || securityGroupIds != "")){
56
56
awsvpcConfiguration["assignPublicIp"] = assignPublicIP
57
57
}
58
- let volumeConfigurations;
58
+ let volumeConfigurations = null ;
59
59
let taskManagedEBSVolumeObject;
60
60
61
61
if (runTaskManagedEBSVolumeName != '') {
@@ -203,7 +203,7 @@ async function updateEcsService(ecs, clusterName, service, taskDefArn, waitForSe
203
203
const serviceManagedEBSVolumeName = core.getInput('service-managed-ebs-volume-name', { required: false }) || '';
204
204
const serviceManagedEBSVolume = core.getInput('service-managed-ebs-volume', { required: false }) || '{}';
205
205
206
- let volumeConfigurations;
206
+ let volumeConfigurations = null ;
207
207
let serviceManagedEbsVolumeObject;
208
208
209
209
if (serviceManagedEBSVolumeName != '') {
@@ -326,9 +326,9 @@ function removeIgnoredAttributes(taskDef) {
326
326
for (var attribute of IGNORED_TASK_DEFINITION_ATTRIBUTES) {
327
327
if (taskDef[attribute]) {
328
328
core.warning(`Ignoring property '${attribute}' in the task definition file. ` +
329
- 'This property is returned by the Amazon ECS DescribeTaskDefinition API and may be shown in the ECS console, ' +
330
- 'but it is not a valid field when registering a new task definition. ' +
331
- 'This field can be safely removed from your task definition file.');
329
+ 'This property is returned by the Amazon ECS DescribeTaskDefinition API and may be shown in the ECS console, ' +
330
+ 'but it is not a valid field when registering a new task definition. ' +
331
+ 'This field can be safely removed from your task definition file.');
332
332
delete taskDef[attribute];
333
333
}
334
334
}
@@ -337,29 +337,29 @@ function removeIgnoredAttributes(taskDef) {
337
337
}
338
338
339
339
function maintainValidObjects(taskDef) {
340
- if (validateProxyConfigurations(taskDef)) {
341
- taskDef.proxyConfiguration.properties.forEach((property, index, arr) => {
342
- if (!('value' in property)) {
343
- arr[index].value = '';
344
- }
345
- if (!('name' in property)) {
346
- arr[index].name = '';
347
- }
348
- });
349
- }
350
-
351
- if(taskDef && taskDef.containerDefinitions){
352
- taskDef.containerDefinitions.forEach((container) => {
353
- if(container.environment){
354
- container.environment.forEach((property, index, arr) => {
355
- if (!('value' in property)) {
356
- arr[index].value = '';
357
- }
340
+ if (validateProxyConfigurations(taskDef)) {
341
+ taskDef.proxyConfiguration.properties.forEach((property, index, arr) => {
342
+ if (!('value' in property)) {
343
+ arr[index].value = '';
344
+ }
345
+ if (!('name' in property)) {
346
+ arr[index].name = '';
347
+ }
358
348
});
359
- }
360
- });
361
- }
362
- return taskDef;
349
+ }
350
+
351
+ if(taskDef && taskDef.containerDefinitions){
352
+ taskDef.containerDefinitions.forEach((container) => {
353
+ if(container.environment){
354
+ container.environment.forEach((property, index, arr) => {
355
+ if (!('value' in property)) {
356
+ arr[index].value = '';
357
+ }
358
+ });
359
+ }
360
+ });
361
+ }
362
+ return taskDef;
363
363
}
364
364
365
365
function validateProxyConfigurations(taskDef){
@@ -391,8 +391,8 @@ async function createCodeDeployDeployment(codedeploy, clusterName, service, task
391
391
392
392
// Insert the task def ARN into the appspec file
393
393
const appSpecPath = path.isAbsolute(codeDeployAppSpecFile) ?
394
- codeDeployAppSpecFile :
395
- path.join(process.env.GITHUB_WORKSPACE, codeDeployAppSpecFile);
394
+ codeDeployAppSpecFile :
395
+ path.join(process.env.GITHUB_WORKSPACE, codeDeployAppSpecFile);
396
396
const fileContents = fs.readFileSync(appSpecPath, 'utf8');
397
397
const appSpecContents = yaml.parse(fileContents);
398
398
0 commit comments