File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -226,6 +226,22 @@ jobs:
226226 run : |
227227 aws ecs wait tasks-stopped --cluster migration-cluster --tasks ${{ steps.ecs-run-task.outputs.task_arn }}
228228
229+ - name : Check ECS Task Exit Code
230+ run : |
231+ TASK_ARN=${{ steps.ecs-run-task.outputs.task_arn }}
232+ EXIT_CODE=$(aws ecs describe-tasks \
233+ --cluster migration-cluster \
234+ --tasks $TASK_ARN \
235+ --query "tasks[0].containers[0].exitCode" \
236+ --output text)
237+
238+ echo "ECS Task Exit Code: $EXIT_CODE"
239+
240+ if [ "$EXIT_CODE" != "0" ]; then
241+ echo "Migration task failed with exit code $EXIT_CODE"
242+ exit 1
243+ fi
244+
229245 - name : Get DB Credentials from SSM
230246 id : get-db-creds
231247 run : |
@@ -262,7 +278,6 @@ jobs:
262278 --cli-binary-format raw-in-base64-out \
263279 response.json
264280
265-
266281# notify:
267282# name: Send Discord Notification (Migration)
268283# runs-on: ubuntu-latest
You can’t perform that action at this time.
0 commit comments