diff --git a/.github/workflows/check_env.yml b/.github/workflows/check_env.yml index 07daaba..f34a984 100644 --- a/.github/workflows/check_env.yml +++ b/.github/workflows/check_env.yml @@ -17,15 +17,21 @@ jobs: # Extract variable names from both files vars1=$(grep -oP '(?<=^)[^#=]+(?==)' .env.example | sort) vars2=$(grep -oP '(?<=^)[^#=]+(?==)' .env.bridge.example | sort) + vars3=$(grep -oP '(?<=^)[^#=]+(?==)' .env.explorer.example | sort) # Find conflicts (variables present in both files) - conflicts=$(comm -12 <(echo "$vars1") <(echo "$vars2")) + conflicts12=$(comm -12 <(echo "$vars1") <(echo "$vars2")) + conflicts13=$(comm -12 <(echo "$vars1") <(echo "$vars3")) + conflicts23=$(comm -12 <(echo "$vars2") <(echo "$vars3")) + + # Combine all conflicts + all_conflicts=$(echo -e "${conflicts12}\n${conflicts13}\n${conflicts23}" | sort -u) # Check if there are any conflicts - if [ -n "$conflicts" ]; then - echo "Conflicts found between .env.example and .env.bridge.example:" - echo "$conflicts" + if [ -n "$all_conflicts" ]; then + echo "Conflicts found between .env.example, .env.bridge.example, and .env.explorer.example:" + echo "$all_conflicts" exit 1 else - echo "No conflicts found between .env.example and .env.bridge.example" + echo "No conflicts found between .env.example, .env.bridge.example, and .env.explorer.example" fi \ No newline at end of file