Skip to content

Commit b8582e3

Browse files
fix validation
1 parent 63e104a commit b8582e3

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

.github/workflows/deploy-supplier-api.yaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,14 @@ jobs:
155155
# --- Cross-validation (only when deploying both) ---
156156
157157
if [[ "$deploy_backend" == "true" && "$deploy_proxy" == "true" ]]; then
158-
if [[ ("$backend_account_group" == "prod") != ("$apim_environment" == "prod") ]]; then
159-
echo "[ERROR] PROD backend and PROD APIM can only be deployed together."
160-
exit 1
161-
fi
158+
case "${backend_account_group}:${apim_environment}" in
159+
dev:internal-dev|nonprod:int|prod:prod) ;;
160+
*)
161+
echo "[ERROR] Mismatched backend/APIM pair: '${backend_account_group}' and '${apim_environment}'."
162+
echo "[ERROR] Valid combinations: dev/internal-dev, nonprod/int, prod/prod."
163+
exit 1
164+
;;
165+
esac
162166
fi
163167
164168
build_artifact_version=""

0 commit comments

Comments
 (0)