diff --git a/action.yml b/action.yml index e1a613c9..ec511ebf 100644 --- a/action.yml +++ b/action.yml @@ -13,6 +13,9 @@ inputs: image: description: 'The URI of the container image to insert into the ECS task definition' required: true + command: + description: 'The command used by ECS to start the container image' + required: false environment-variables: description: 'Variables to add to the container. Each variable is of the form KEY=value, you can specify multiple variables with multi-line YAML strings.' required: false diff --git a/dist/index.js b/dist/index.js index ddd1020b..63eead90 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1194,6 +1194,7 @@ async function run() { const imageURI = core.getInput('image', { required: true }); const environmentVariables = core.getInput('environment-variables', { required: false }); + const command = core.getInput('command', { required: false }); // Parse the task definition const taskDefPath = path.isAbsolute(taskDefinitionFile) ? @@ -1216,6 +1217,10 @@ async function run() { } containerDef.image = imageURI; + if (command) { + containerDef.command = command.split(' ') + } + if (environmentVariables) { // If environment array is missing, create it diff --git a/index.js b/index.js index 99bb717d..d6149f96 100644 --- a/index.js +++ b/index.js @@ -11,6 +11,7 @@ async function run() { const imageURI = core.getInput('image', { required: true }); const environmentVariables = core.getInput('environment-variables', { required: false }); + const command = core.getInput('command', { required: false }); // Parse the task definition const taskDefPath = path.isAbsolute(taskDefinitionFile) ? @@ -33,6 +34,10 @@ async function run() { } containerDef.image = imageURI; + if (command) { + containerDef.command = command.split(' ') + } + if (environmentVariables) { // If environment array is missing, create it