Skip to content

Commit aab45d6

Browse files
committed
fixing additional comments from reviewers
1 parent 231f294 commit aab45d6

File tree

4 files changed

+437
-14
lines changed

4 files changed

+437
-14
lines changed

dist/index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,8 @@ async function runTask(ecs,clusterName, taskDefArn, waitForMinutes) {
4040
const containerOverrides = JSON.parse(core.getInput('run-task-container-overrides', { required: false }) || '[]');
4141
const assignPublicIP = core.getInput('run-task-assign-public-IP', { required: false }) || 'DISABLED';
4242

43-
4443
let awsvpcConfiguration = {}
4544

46-
4745
if (subnetIds != "") {
4846
awsvpcConfiguration["subnets"] = subnetIds.split(',')
4947
}
@@ -77,7 +75,7 @@ async function runTask(ecs,clusterName, taskDefArn, waitForMinutes) {
7775
const region = await ecs.config.region();
7876
const consoleHostname = region.startsWith('cn') ? 'console.amazonaws.cn' : 'console.aws.amazon.com';
7977

80-
core.info(`Task running: https://${consoleHostname}/ecs/home?region=${region}#/clusters/${clusterName}/tasks`);
78+
core.info(`Task running: https://${consoleHostname}/ecs/home?region=${region}#/clusters/${clusterName}/task/${runTaskResponse}`);
8179

8280

8381
if (runTaskResponse.failures && runTaskResponse.failures.length > 0) {
@@ -149,7 +147,7 @@ async function updateEcsService(ecs, clusterName, service, taskDefArn, waitForSe
149147
cluster: clusterName,
150148
service: service,
151149
taskDefinition: taskDefArn,
152-
forceNewDeployment: forceNewDeployment,
150+
forceNewDeployment: forceNewDeployment
153151
};
154152

155153
// Add the desiredCount property only if it is defined and a number.
@@ -346,8 +344,10 @@ async function createCodeDeployDeployment(codedeploy, clusterName, service, task
346344
}
347345
};
348346
// If it hasn't been set then we don't even want to pass it to the api call to maintain previous behaviour.
347+
let codeDeployDescriptionLimit = 512;
348+
349349
if (codeDeployDescription) {
350-
deploymentParams.description = (codeDeployDescription.length <= 512) ? codeDeployDescription : `${codeDeployDescription.substring(0,511)}…`;
350+
deploymentParams.description = (codeDeployDescription.length <= codeDeployDescriptionLimit) ? codeDeployDescription : `${codeDeployDescription.substring(0,511)}…`;
351351
}
352352
if (codeDeployConfig) {
353353
deploymentParams.deploymentConfigName = codeDeployConfig

index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,8 @@ async function runTask(ecs,clusterName, taskDefArn, waitForMinutes) {
3434
const containerOverrides = JSON.parse(core.getInput('run-task-container-overrides', { required: false }) || '[]');
3535
const assignPublicIP = core.getInput('run-task-assign-public-IP', { required: false }) || 'DISABLED';
3636

37-
3837
let awsvpcConfiguration = {}
3938

40-
4139
if (subnetIds != "") {
4240
awsvpcConfiguration["subnets"] = subnetIds.split(',')
4341
}
@@ -71,7 +69,7 @@ async function runTask(ecs,clusterName, taskDefArn, waitForMinutes) {
7169
const region = await ecs.config.region();
7270
const consoleHostname = region.startsWith('cn') ? 'console.amazonaws.cn' : 'console.aws.amazon.com';
7371

74-
core.info(`Task running: https://${consoleHostname}/ecs/home?region=${region}#/clusters/${clusterName}/tasks`);
72+
core.info(`Task running: https://${consoleHostname}/ecs/home?region=${region}#/clusters/${clusterName}/task/${runTaskResponse}`);
7573

7674

7775
if (runTaskResponse.failures && runTaskResponse.failures.length > 0) {
@@ -143,7 +141,7 @@ async function updateEcsService(ecs, clusterName, service, taskDefArn, waitForSe
143141
cluster: clusterName,
144142
service: service,
145143
taskDefinition: taskDefArn,
146-
forceNewDeployment: forceNewDeployment,
144+
forceNewDeployment: forceNewDeployment
147145
};
148146

149147
// Add the desiredCount property only if it is defined and a number.
@@ -340,8 +338,10 @@ async function createCodeDeployDeployment(codedeploy, clusterName, service, task
340338
}
341339
};
342340
// If it hasn't been set then we don't even want to pass it to the api call to maintain previous behaviour.
341+
let codeDeployDescriptionLimit = 512;
342+
343343
if (codeDeployDescription) {
344-
deploymentParams.description = (codeDeployDescription.length <= 512) ? codeDeployDescription : `${codeDeployDescription.substring(0,511)}…`;
344+
deploymentParams.description = (codeDeployDescription.length <= codeDeployDescriptionLimit) ? codeDeployDescription : `${codeDeployDescription.substring(0,511)}…`;
345345
}
346346
if (codeDeployConfig) {
347347
deploymentParams.deploymentConfigName = codeDeployConfig

0 commit comments

Comments
 (0)