@@ -76520,12 +76520,16 @@ const main = async () => {
76520
76520
core.setOutput('task-id', taskId);
76521
76521
core.info(`Starting Task with ARN: ${taskArn}\n`);
76522
76522
76523
- // Wait for task to be in running state
76524
- core.debug(`Waiting for task to be in running state.`)
76525
- await waitUntilTasksRunning({
76526
- client: ecs,
76527
- maxWaitTime: taskStartMaxWaitTime,
76528
- }, {cluster, tasks: [taskArn]});
76523
+ try {
76524
+ core.debug(`Waiting for task to be in running state. Waiting for ${taskStartMaxWaitTime} seconds.`);
76525
+ await waitUntilTasksRunning({
76526
+ client: ecs,
76527
+ maxWaitTime: taskStartMaxWaitTime,
76528
+ }, {cluster, tasks: [taskArn]});
76529
+ } catch (error) {
76530
+ core.setFailed(`Task did not start successfully. Error: ${error.name}. State: ${error.state}.`);
76531
+ return;
76532
+ }
76529
76533
76530
76534
// If taskWaitUntilStopped is false, we can bail out here because we can not tail logs or have any
76531
76535
// information on the exitCodes or status of the task
@@ -76587,15 +76591,18 @@ const main = async () => {
76587
76591
}
76588
76592
}
76589
76593
76590
- // Wait for Task to finish
76591
- core.debug(`Waiting for task to finish.`);
76592
- await waitUntilTasksStopped({
76593
- client: ecs,
76594
- maxWaitTime: taskStoppedMaxWaitTime,
76595
- }, {
76596
- cluster,
76597
- tasks: [taskArn],
76598
- });
76594
+ try {
76595
+ core.debug(`Waiting for task to finish. Waiting for ${taskStoppedMaxWaitTime} seconds.`);
76596
+ await waitUntilTasksStopped({
76597
+ client: ecs,
76598
+ maxWaitTime: taskStoppedMaxWaitTime,
76599
+ }, {
76600
+ cluster,
76601
+ tasks: [taskArn],
76602
+ });
76603
+ } catch (error) {
76604
+ core.setFailed(`Task did not stop successfully. Error: ${error.name}. State: ${error.state}.`);
76605
+ }
76599
76606
76600
76607
// Close LogStream and store output
76601
76608
if (logFilterStream !== null) {
0 commit comments