diff --git a/index.js b/index.js index 77d5b1bf..ccddceb0 100644 --- a/index.js +++ b/index.js @@ -40,8 +40,7 @@ async function run() { throw new Error('Invalid task definition: Could not find container definition with matching name'); } containerDef.image = imageURI; - containerDef.executionRoleArn = taskRoleArn; - containerDef.taskRoleArn = executionRoleArn; + if (command) { containerDef.command = command.split(' ') @@ -126,6 +125,14 @@ async function run() { }) } + if (taskRoleArn) { + taskDefContents.taskRoleArn = taskRoleArn; + } + + if (executionRoleArn) { + taskDefContents.executionRoleArn = executionRoleArn; + } + // Write out a new task definition file var updatedTaskDefFile = tmp.fileSync({ tmpdir: process.env.RUNNER_TEMP,