Skip to content

Commit 5fdf7cd

Browse files
committed
Refactor for readability
1 parent b2fdd24 commit 5fdf7cd

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

index.js

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -454,24 +454,11 @@ async function createCodeDeployDeployment(codedeploy, clusterName, service, task
454454

455455
async function run() {
456456
try {
457-
const maxRetries = parseInt(core.getInput('max-retries', { required: false })) || 3;
458-
459-
const ecs = new ECS({
460-
customUserAgent: 'amazon-ecs-deploy-task-definition-for-github-actions',
461-
maxAttempts: maxRetries,
462-
retryMode: 'standard'
463-
});
464-
465-
const codedeploy = new CodeDeploy({
466-
customUserAgent: 'amazon-ecs-deploy-task-definition-for-github-actions',
467-
maxAttempts: maxRetries,
468-
retryMode: 'standard'
469-
});
470-
471457
// Get inputs
472458
const taskDefinitionFile = core.getInput('task-definition', { required: true });
473459
const service = core.getInput('service', { required: false });
474460
const cluster = core.getInput('cluster', { required: false });
461+
const maxRetries = parseInt(core.getInput('max-retries', { required: false })) || 3;
475462
const waitForService = core.getInput('wait-for-service-stability', { required: false });
476463
let waitForMinutes = parseInt(core.getInput('wait-for-minutes', { required: false })) || 30;
477464

@@ -493,6 +480,18 @@ async function run() {
493480
propagateTags = propagateTagsInput;
494481
}
495482

483+
const ecs = new ECS({
484+
customUserAgent: 'amazon-ecs-deploy-task-definition-for-github-actions',
485+
maxAttempts: maxRetries,
486+
retryMode: 'standard'
487+
});
488+
489+
const codedeploy = new CodeDeploy({
490+
customUserAgent: 'amazon-ecs-deploy-task-definition-for-github-actions',
491+
maxAttempts: maxRetries,
492+
retryMode: 'standard'
493+
});
494+
496495
// Register the task definition
497496
core.debug('Registering the task definition');
498497
const taskDefPath = path.isAbsolute(taskDefinitionFile) ?

0 commit comments

Comments
 (0)