@@ -35,6 +35,7 @@ async function runTask(ecs, clusterName, taskDefArn, waitForMinutes) {
35
35
const launchType = core.getInput('run-task-launch-type', { required: false }) || 'FARGATE';
36
36
const subnetIds = core.getInput('run-task-subnets', { required: false }) || '';
37
37
const securityGroupIds = core.getInput('run-task-security-groups', { required: false }) || '';
38
+ const assignPublicIp = core.getInput('run-task-assign-public-ip', { required: false }) || '';
38
39
const containerOverrides = JSON.parse(core.getInput('run-task-container-overrides', { required: false }) || '[]');
39
40
let awsvpcConfiguration = {}
40
41
@@ -46,6 +47,10 @@ async function runTask(ecs, clusterName, taskDefArn, waitForMinutes) {
46
47
awsvpcConfiguration["securityGroups"] = securityGroupIds.split(',')
47
48
}
48
49
50
+ if (assignPublicIp != "") {
51
+ awsvpcConfiguration["assignPublicIp"] = assignPublicIp ? "ENABLED" : "DISABLED"
52
+ }
53
+
49
54
const runTaskResponse = await ecs.runTask({
50
55
startedBy: startedBy,
51
56
cluster: clusterName,
@@ -61,11 +66,7 @@ async function runTask(ecs, clusterName, taskDefArn, waitForMinutes) {
61
66
62
67
const taskArns = runTaskResponse.tasks.map(task => task.taskArn);
63
68
core.setOutput('run-task-arn', taskArns);
64
-
65
- taskArns.map(taskArn => {
66
- let taskId = taskArn.split('/').pop();
67
- core.info(`Task running: https://console.aws.amazon.com/ecs/home?region=${aws.config.region}#/clusters/${clusterName}/tasks`)
68
- });
69
+ core.info(`Task running: https://console.aws.amazon.com/ecs/home?region=${aws.config.region}#/clusters/${clusterName}/tasks`);
69
70
70
71
if (runTaskResponse.failures && runTaskResponse.failures.length > 0) {
71
72
const failure = runTaskResponse.failures[0];
@@ -322,9 +323,11 @@ async function createCodeDeployDeployment(codedeploy, clusterName, service, task
322
323
}
323
324
}
324
325
};
326
+
325
327
// If it hasn't been set then we don't even want to pass it to the api call to maintain previous behaviour.
326
328
if (codeDeployDescription) {
327
- deploymentParams.description = codeDeployDescription
329
+ // CodeDeploy Deployment Descriptions have a max length of 512 characters, so truncate if necessary
330
+ deploymentParams.description = (codeDeployDescription.length <= 512) ? codeDeployDescription : `${codeDeployDescription.substring(0,511)}…`;
328
331
}
329
332
const createDeployResponse = await codedeploy.createDeployment(deploymentParams).promise();
330
333
core.setOutput('codedeploy-deployment-id', createDeployResponse.deploymentId);
0 commit comments