Skip to content

Commit

Permalink
add three files comp
Browse files Browse the repository at this point in the history
  • Loading branch information
bournezjc committed Oct 21, 2024
1 parent c66a7e2 commit 55646de
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions .github/workflows/check_env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 55646de

Please sign in to comment.