From 25964ab29de55887cdd7aa22c04d658bd6d60716 Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Fri, 23 Oct 2026 21:57:50 -0700 Subject: [PATCH] fix(ci): pick the CodeDeploy action when the app Deploy stage has sidecar actions The app pipeline's Deploy stage can now also run a CodeBuild image deploy for the sandbox worker host. The cutover wait required exactly one Deploy action, so Trigger.dev promotion failed whenever that action was present. Select the CodeDeployToECS action by provider; everything after it is unchanged. --- .github/scripts/wait-for-ecs-cutover.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/scripts/wait-for-ecs-cutover.sh b/.github/scripts/wait-for-ecs-cutover.sh index 4e9b10f5d66..8d3ed477370 100755 --- a/.github/scripts/wait-for-ecs-cutover.sh +++ b/.github/scripts/wait-for-ecs-cutover.sh @@ -92,12 +92,15 @@ while [ -z "$DEPLOYMENT_ID" ] || [ "$DEPLOYMENT_ID" = 'None' ]; do DEPLOYMENT_ID=$(printf '%s\n' "$deploy_actions" | DEPLOY_STATE="$deploy_state" EXECUTION_ID="$EXECUTION_ID" python3 -c ' import json, os, re, sys state = json.loads(os.environ["DEPLOY_STATE"]) -actions = json.load(sys.stdin) +# The Deploy stage can also run sidecar actions (e.g. a CodeBuild image deploy); only the +# CodeDeploy blue/green action carries the ECS cutover. +actions = [a for a in json.load(sys.stdin) + if a.get("input", {}).get("actionTypeId", {}).get("provider") == "CodeDeployToECS"] if not state or state.get("latestExecution", {}).get("pipelineExecutionId") != os.environ["EXECUTION_ID"] or not actions: print("") sys.exit(0) if len({a["actionName"] for a in actions}) != 1: - raise SystemExit("ERROR: expected one Deploy action in the app pipeline") + raise SystemExit("ERROR: expected one CodeDeploy ECS action in the app pipeline Deploy stage") latest = max(actions, key=lambda a: a["startTime"]) matches = [a["latestExecution"] for a in state.get("actionStates", []) if a["actionName"] == latest["actionName"]