Skip to content

Commit

Permalink
feat(gha): get exit code from run-task
Browse files Browse the repository at this point in the history
  • Loading branch information
briancaffey committed Mar 6, 2024
1 parent 527de34 commit 080e802
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/ecr-run-task/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,17 @@ runs:
--start-time $START_TIME \
--end-time $END_TIME \
| jq -r '.events[].message'
# Get exit code
TASK_EXIT_CODE=$(
aws ecs describe-tasks \
--cluster $APP_ENV-cluster \
--tasks $TASK_ID \
--query "tasks[0].containers[?name=='$CONTAINER_NAME'].exitCode" \
--output text)
echo "Task exit code is $TASK_EXIT_CODE"
# exit with the same code
# if this fails, we should not continue with rest of the deployment
exit $TASK_EXIT_CODE

0 comments on commit 080e802

Please sign in to comment.