From a113a73a99c293d243554e012b930237836f5d78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Bl=C3=A4cker?= Date: Tue, 3 Sep 2024 09:35:54 +0700 Subject: [PATCH] test --- .github/workflows/protectAuditorsGroup.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/protectAuditorsGroup.yml b/.github/workflows/protectAuditorsGroup.yml index 7f26d4724..a71fd8ac0 100644 --- a/.github/workflows/protectAuditorsGroup.yml +++ b/.github/workflows/protectAuditorsGroup.yml @@ -52,6 +52,7 @@ jobs: # Convert string to sorted lines and remove empty lines echo "$SC_ADMINS_MEMBERS" | tr ' ' '\n' | sort | uniq > sc_admins_sorted.txt + echo "$SC_CORE_MEMBERS" | tr ' ' '\n' | sort | uniq > sc_core_sorted.txt echo "$AUDITORS_MEMBERS" | tr ' ' '\n' | sort | uniq > auditors_sorted.txt # Check if both files exist and are not empty @@ -60,8 +61,7 @@ jobs: exit 1 fi - echo "Checking overlap between SC_ADMINS and AUDITORS..." - # OVERLAP=$(echo "$SC_ADMINS_MEMBERS" | grep -Fxf - <(echo "$AUDITORS_MEMBERS")) || { echo "Overlap check failed"; exit 1; } + echo "Checking for git users that are members of both $SC_ADMINS and $AUDITORS team..." OVERLAP=$(comm -12 sc_admins_sorted.txt auditors_sorted.txt) if [ -n "$OVERLAP" ]; then @@ -72,6 +72,17 @@ jobs: echo -e "\033[32mNo overlap found between $SC_ADMINS and $AUDITORS.\033[0m" fi + echo "Checking for git users that are members of both $SC_CORE and $AUDITORS team..." + OVERLAP=$(comm -12 sc_admins_sorted.txt auditors_sorted.txt) + + if [ -n "$OVERLAP" ]; then + echo -e "\033[31mERROR: The following git users are members of both $SC_CORE and $AUDITORS groups: $overlap\033[0m" + echo -e "\033[31mAuditors must be external personnel and cannot be team members or admins\033[0m" + exit 1 + else + echo -e "\033[32mNo overlap found between $SC_CORE and $AUDITORS.\033[0m" + fi + # ##### Check overlap between smart-contract-core and auditors # overlap=$(echo "$SC_ADMINS_MEMBERS" | grep -Fxf - <(echo "$AUDITORS_MEMBERS"))