Skip to content

Commit eedbf4b

Browse files
committed
fix: use mapfile and for loop for branch iteration
Replace process substitution with explicit mapfile to load branches into an array, then iterate with for loop. This is more reliable in GitHub Actions bash environment.
1 parent faa824b commit eedbf4b

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

.github/workflows/auto-update-prs.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,10 @@ jobs:
7777
FAILURE_COUNT=0
7878
SKIPPED_COUNT=0
7979
80-
while IFS= read -r branch; do
80+
# Convert JSON array to bash array
81+
mapfile -t BRANCH_ARRAY < <(echo "$BRANCHES" | jq -r '.[]')
82+
83+
for branch in "${BRANCH_ARRAY[@]}"; do
8184
[ -z "$branch" ] && continue
8285
8386
echo ""
@@ -108,7 +111,7 @@ jobs:
108111
git rebase --abort || true
109112
((FAILURE_COUNT++))
110113
fi
111-
done < <(echo "$BRANCHES" | jq -r '.[]')
114+
done
112115
113116
echo ""
114117
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"

0 commit comments

Comments
 (0)