Skip to content

Commit a34d73e

Browse files
committed
skip task not finished error when taskWaitUntilStopped is true
1 parent 0e23f48 commit a34d73e

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

dist/index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56621,6 +56621,7 @@ const main = async () => {
5662156621
}));
5662256622

5662356623
await handleCWResponseAsync(response);
56624+
core.debug(`LogGroupARN finished.`);
5662456625
} catch (err) {
5662556626
core.error(err.message);
5662656627
}
@@ -56641,8 +56642,11 @@ const main = async () => {
5664156642
}, {cluster, tasks: [taskArn]});
5664256643
core.debug(`waitECSTaskResult: ${waitECSTaskResult.state} / ${JSON.stringify(waitECSTaskResult)}`);
5664356644
} catch (error) {
56644-
core.setFailed(`Task did not start successfully. Error: ${error.message}.`);
56645-
process.exit(1);
56645+
// if taskWaitUntilStopped is true, the exit code is validated, and therefore we can skip this step
56646+
if (!taskWaitUntilStopped) {
56647+
core.setFailed(`Task did not start successfully. Error: ${error.message}.`);
56648+
process.exit(1);
56649+
}
5664656650
}
5664756651

5664856652
// If taskWaitUntilStopped is false, we can bail out here because we can not tail logs or have any

index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ const main = async () => {
157157
}));
158158

159159
await handleCWResponseAsync(response);
160+
core.debug(`LogGroupARN finished.`);
160161
} catch (err) {
161162
core.error(err.message);
162163
}
@@ -177,8 +178,11 @@ const main = async () => {
177178
}, {cluster, tasks: [taskArn]});
178179
core.debug(`waitECSTaskResult: ${waitECSTaskResult.state} / ${JSON.stringify(waitECSTaskResult)}`);
179180
} catch (error) {
180-
core.setFailed(`Task did not start successfully. Error: ${error.message}.`);
181-
process.exit(1);
181+
// if taskWaitUntilStopped is true, the exit code is validated, and therefore we can skip this step
182+
if (!taskWaitUntilStopped) {
183+
core.setFailed(`Task did not start successfully. Error: ${error.message}.`);
184+
process.exit(1);
185+
}
182186
}
183187

184188
// If taskWaitUntilStopped is false, we can bail out here because we can not tail logs or have any

0 commit comments

Comments
 (0)