Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0c9e3e8672 |
@@ -94,14 +94,14 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
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')
|
'[.[] | select(.user.login == $user)] | last | if .state then .state == "APPROVED" else false end')
|
||||||
|
|
||||||
echo "${GATE_NAME} (${REQUIRED_REVIEWER}) approved: ${REVIEWER_APPROVED}"
|
echo "${GATE_NAME} (${REQUIRED_REVIEWER}) approved: ${REVIEWER_APPROVED}"
|
||||||
|
|
||||||
# Fallback: check if CTO approved as alternative for uat→main
|
# Fallback: check if CTO approved as alternative for uat→main
|
||||||
if [ "${REVIEWER_APPROVED}" != "true" ] && [ -n "${ALT_REVIEWER}" ]; then
|
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')
|
'[.[] | select(.user.login == $user)] | last | if .state then .state == "APPROVED" else false end')
|
||||||
if [ "${REVIEWER_APPROVED}" = "true" ]; then
|
if [ "${REVIEWER_APPROVED}" = "true" ]; then
|
||||||
echo "CTO (${ALT_REVIEWER}) approved as fallback for UAT gate."
|
echo "CTO (${ALT_REVIEWER}) approved as fallback for UAT gate."
|
||||||
|
|||||||
Reference in New Issue
Block a user