Compare commits

..

1 Commits

Author SHA1 Message Date
Chris Farhood 239149adeb fix(dual-approval): replace echo with printf to avoid jq parse errors (PRI-1757)
CI / ci (push) Failing after 13m27s
Promotion Gate / Promotion Gate (pull_request) Failing after 4m0s
CI / ci (pull_request) Failing after 1m4s
Promotion Gate / Promotion Gate (pull_request_review) Failing after 4m1s
2026-05-30 23:15:56 +00:00
+2 -2
View File
@@ -94,14 +94,14 @@ jobs:
exit 1
fi
REVIEWER_APPROVED=$(echo "${REVIEWS}" | jq -r --arg user "${REQUIRED_REVIEWER}" \
REVIEWER_APPROVED=$(printf '%s' "${REVIEWS}" | jq -r --arg user "${REQUIRED_REVIEWER}" \
'[.[] | select(.user.login == $user)] | last | if .state then .state == "APPROVED" else false end')
echo "${GATE_NAME} (${REQUIRED_REVIEWER}) approved: ${REVIEWER_APPROVED}"
# Fallback: check if CTO approved as alternative for uat→main
if [ "${REVIEWER_APPROVED}" != "true" ] && [ -n "${ALT_REVIEWER}" ]; then
REVIEWER_APPROVED=$(echo "${REVIEWS}" | jq -r --arg user "${ALT_REVIEWER}" \
REVIEWER_APPROVED=$(printf '%s' "${REVIEWS}" | jq -r --arg user "${ALT_REVIEWER}" \
'[.[] | select(.user.login == $user)] | last | if .state then .state == "APPROVED" else false end')
if [ "${REVIEWER_APPROVED}" = "true" ]; then
echo "CTO (${ALT_REVIEWER}) approved as fallback for UAT gate."