@@ -468,24 +468,11 @@ async function createCodeDeployDeployment(codedeploy, clusterName, service, task
468468
469469async function run ( ) {
470470 try {
471- const maxRetries = parseInt ( core . getInput ( 'max-retries' , { required : false } ) ) || 3 ;
472-
473- const ecs = new ECS ( {
474- customUserAgent : 'amazon-ecs-deploy-task-definition-for-github-actions' ,
475- maxAttempts : maxRetries ,
476- retryMode : 'standard'
477- } ) ;
478-
479- const codedeploy = new CodeDeploy ( {
480- customUserAgent : 'amazon-ecs-deploy-task-definition-for-github-actions' ,
481- maxAttempts : maxRetries ,
482- retryMode : 'standard'
483- } ) ;
484-
485471 // Get inputs
486472 const taskDefinitionFile = core . getInput ( 'task-definition' , { required : true } ) ;
487473 const service = core . getInput ( 'service' , { required : false } ) ;
488474 const cluster = core . getInput ( 'cluster' , { required : false } ) ;
475+ const maxRetries = parseInt ( core . getInput ( 'max-retries' , { required : false } ) ) || 3 ;
489476 const waitForService = core . getInput ( 'wait-for-service-stability' , { required : false } ) ;
490477 let waitForMinutes = parseInt ( core . getInput ( 'wait-for-minutes' , { required : false } ) ) || 30 ;
491478
@@ -514,6 +501,17 @@ async function run() {
514501 if ( keepNullValueKeysInput ) {
515502 keepNullValueKeys = keepNullValueKeysInput . split ( ',' ) . map ( k => k . trim ( ) ) . filter ( Boolean ) ;
516503 }
504+ const ecs = new ECS ( {
505+ customUserAgent : 'amazon-ecs-deploy-task-definition-for-github-actions' ,
506+ maxAttempts : maxRetries ,
507+ retryMode : 'standard'
508+ } ) ;
509+
510+ const codedeploy = new CodeDeploy ( {
511+ customUserAgent : 'amazon-ecs-deploy-task-definition-for-github-actions' ,
512+ maxAttempts : maxRetries ,
513+ retryMode : 'standard'
514+ } ) ;
517515
518516 // Register the task definition
519517 core . debug ( 'Registering the task definition' ) ;
0 commit comments