-
Notifications
You must be signed in to change notification settings - Fork 155
feat: Add support for task and execution role ARNs in action.yml and … #293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
6a9e92f
bcab98a
4051026
240e7ec
d26b24f
f29f292
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,6 +45,9 @@ async function run() { | |
const logConfigurationOptions = core.getInput("log-configuration-options", { required: false }); | ||
const dockerLabels = core.getInput('docker-labels', { required: false }); | ||
const command = core.getInput('command', { required: false }); | ||
const taskRoleArn = core.getInput('task-role-arn', { required: false }); | ||
const executionRoleArn = core.getInput('execution-role-arn', { required: false }); | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: could you remove unnecessary whitespace? |
||
|
||
//New inputs to fetch task definition | ||
const taskDefinitionArn = core.getInput('task-definition-arn', { required: false }) || undefined; | ||
|
@@ -109,6 +112,7 @@ async function run() { | |
} | ||
containerDef.image = imageURI; | ||
|
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: could you remove unnecessary whitespace? |
||
if (command) { | ||
containerDef.command = command.split(' ') | ||
} | ||
|
@@ -245,6 +249,14 @@ async function run() { | |
}) | ||
} | ||
|
||
if (taskRoleArn) { | ||
taskDefContents.taskRoleArn = taskRoleArn; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we add a regex validation for the arn? Need appropriate unit tests as well for these changes. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ECS actually allows name-only format (if the role is in the same account as the task definition), and we rely on that to deploy the same task definition across multiple accounts. |
||
} | ||
|
||
if (executionRoleArn) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we add a regex validation for the arn? Need appropriate unit tests as well for these changes. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ECS actually allows name-only format (if the role is in the same account as the task definition), and we rely on that to deploy the same task definition across multiple accounts. |
||
taskDefContents.executionRoleArn = executionRoleArn; | ||
} | ||
|
||
// Write out a new task definition file | ||
var updatedTaskDefFile = tmp.fileSync({ | ||
tmpdir: process.env.RUNNER_TEMP, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This description can be made more explicit, as it could confuse some users since it's self-referencing.
Suggested reword: 'The ARN of the IAM role that the task definition will assume to run the task'