Skip to content

Commit

Permalink
try as array in env
Browse files Browse the repository at this point in the history
Signed-off-by: Peter St. John <[email protected]>
  • Loading branch information
pstjohn committed Jan 22, 2025
1 parent 071a4c5 commit 10e3abb
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions .github/workflows/approvals.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@ on:
pull_request: # TODO: remove

env:
TIER2_REVIEWERS: |
jstjohn
trvachov
pstjohn
jomitchellnv
TIER2_REVIEWERS: ("jstjohn" "trvachov" "pstjohn" "jomitchellnv")

jobs:
enforce_tiered_approvals:
Expand Down Expand Up @@ -50,14 +46,10 @@ jobs:
echo "Approved Users: $APPROVED_USERS"
echo "Tier 2 Reviewers: $TIER2_REVIEWERS"
IFS=$'\n' read -r -d '' -a TIER2_REVIEWERS_ARRAY <<< "$TIER2_REVIEWERS"
echo "TIER2_REVIEWERS_ARRAY: ${!TIER2_REVIEWERS_ARR[@]}"
# Iterate over approved users and compare with cleaned TIER2_REVIEWERS
for USER in ${APPROVED_USERS//,/ }; do
echo "Checking approved USER: $USER"
for REVIEWER in "${!TIER2_REVIEWERS_ARR[@]}"; do
for REVIEWER in "${!TIER2_REVIEWERS[@]}"; do
echo "Comparing USER: $USER with REVIEWER: $REVIEWER"
if [[ "$USER" == "$REVIEWER" ]]; then
TIER2_APPROVED=true
Expand Down

0 comments on commit 10e3abb

Please sign in to comment.