Log describe AWS tasks upon non success exit code

pull/289/head
Frostebite 2021-08-13 20:24:45 +01:00
parent 33a1fb743b
commit 94c046a9c3
3 changed files with 5 additions and 5 deletions

4
dist/index.js vendored
View File

@ -1220,11 +1220,11 @@ class AWSBuildRunner {
cluster, cluster,
}).promise()).tasks) === null || _r === void 0 ? void 0 : _r[0].containers) === null || _s === void 0 ? void 0 : _s[0].exitCode; }).promise()).tasks) === null || _r === void 0 ? void 0 : _r[0].containers) === null || _s === void 0 ? void 0 : _s[0].exitCode;
if (exitCode !== 0) { if (exitCode !== 0) {
core.error(`job failed with exit code ${exitCode}`); core.error(`job failed with exit code ${exitCode} ${JSON.stringify(yield ECS.describeTasks({
throw new Error(`job failed with exit code ${exitCode} ${JSON.stringify(yield ECS.describeTasks({
tasks: [taskArn], tasks: [taskArn],
cluster, cluster,
}).promise(), undefined, 4)}`); }).promise(), undefined, 4)}`);
throw new Error(`job failed with exit code ${exitCode}`);
} }
else { else {
core.info(`Task has finished successfully`); core.info(`Task has finished successfully`);

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -73,8 +73,7 @@ class AWSBuildRunner {
}).promise() }).promise()
).tasks?.[0].containers?.[0].exitCode; ).tasks?.[0].containers?.[0].exitCode;
if (exitCode !== 0) { if (exitCode !== 0) {
core.error(`job failed with exit code ${exitCode}`); core.error(
throw new Error(
`job failed with exit code ${exitCode} ${JSON.stringify( `job failed with exit code ${exitCode} ${JSON.stringify(
await ECS.describeTasks({ await ECS.describeTasks({
tasks: [taskArn], tasks: [taskArn],
@ -84,6 +83,7 @@ class AWSBuildRunner {
4, 4,
)}`, )}`,
); );
throw new Error(`job failed with exit code ${exitCode}`);
} else { } else {
core.info(`Task has finished successfully`); core.info(`Task has finished successfully`);
} }