@@ -201,6 +201,7 @@ async function runTask(ecs, clusterName, taskDefArn, waitForMinutes) {
201
201
const launchType = core.getInput('run-task-launch-type', { required: false }) || 'FARGATE';
202
202
const subnetIds = core.getInput('run-task-subnets', { required: false }) || '';
203
203
const securityGroupIds = core.getInput('run-task-security-groups', { required: false }) || '';
204
+ const assignPublicIp = core.getInput('run-task-assign-public-ip', { required: false }) || '';
204
205
const containerOverrides = JSON.parse(core.getInput('run-task-container-overrides', { required: false }) || '[]');
205
206
let awsvpcConfiguration = {}
206
207
@@ -212,6 +213,10 @@ async function runTask(ecs, clusterName, taskDefArn, waitForMinutes) {
212
213
awsvpcConfiguration["securityGroups"] = securityGroupIds.split(',')
213
214
}
214
215
216
+ if (assignPublicIp != "") {
217
+ awsvpcConfiguration["assignPublicIp"] = assignPublicIp ? "ENABLED" : "DISABLED"
218
+ }
219
+
215
220
const runTaskResponse = await ecs.runTask({
216
221
startedBy: startedBy,
217
222
cluster: clusterName,
@@ -227,11 +232,7 @@ async function runTask(ecs, clusterName, taskDefArn, waitForMinutes) {
227
232
228
233
const taskArns = runTaskResponse.tasks.map(task => task.taskArn);
229
234
core.setOutput('run-task-arn', taskArns);
230
-
231
- taskArns.map(taskArn => {
232
- let taskId = taskArn.split('/').pop();
233
- core.info(`Task running: https://console.aws.amazon.com/ecs/home?region=${aws.config.region}#/clusters/${clusterName}/tasks`)
234
- });
235
+ core.info(`Task running: https://console.aws.amazon.com/ecs/home?region=${aws.config.region}#/clusters/${clusterName}/tasks`);
235
236
236
237
if (runTaskResponse.failures && runTaskResponse.failures.length > 0) {
237
238
const failure = runTaskResponse.failures[0];
@@ -485,9 +486,11 @@ async function createCodeDeployDeployment(codedeploy, clusterName, service, task
485
486
}
486
487
}
487
488
};
489
+
488
490
// If it hasn't been set then we don't even want to pass it to the api call to maintain previous behaviour.
489
491
if (codeDeployDescription) {
490
- deploymentParams.description = codeDeployDescription
492
+ // CodeDeploy Deployment Descriptions have a max length of 512 characters, so truncate if necessary
493
+ deploymentParams.description = (codeDeployDescription.length <= 512) ? codeDeployDescription : `${codeDeployDescription.substring(0,511)}…`;
491
494
}
492
495
const createDeployResponse = await codedeploy.createDeployment(deploymentParams).promise();
493
496
core.setOutput('codedeploy-deployment-id', createDeployResponse.deploymentId);
0 commit comments