Skip to content

Commit

Permalink
echo delete
Browse files Browse the repository at this point in the history
  • Loading branch information
bdemann committed Oct 25, 2024
1 parent 386e5b6 commit 9e6ddf2
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/release_parallel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -252,17 +252,31 @@ jobs:
- name: Delete branches
run: |
echo "Starting branch deletion process..."
echo "Raw branches input:"
echo "${{ steps.collect-branches.outputs.branches }}"
# Convert newline-separated string to array
IFS=$'\n' read -r -d '' -a BRANCHES_TO_DELETE <<< "${{ steps.collect-branches.outputs.branches }}"
echo "Number of branches to delete: ${#BRANCHES_TO_DELETE[@]}"
echo "All branches to delete:"
printf '%s\n' "${BRANCHES_TO_DELETE[@]}"
# Delete branches in batches of 100
BATCH_SIZE=100
for ((i = 0; i < ${#BRANCHES_TO_DELETE[@]}; i += BATCH_SIZE)); do
BATCH=("${BRANCHES_TO_DELETE[@]:i:BATCH_SIZE}")
echo "Processing batch starting at index $i"
echo "Batch size: ${#BATCH[@]}"
echo "Batch contents:"
printf '%s\n' "${BATCH[@]}"
echo "Deleting batch of branches: ${BATCH[*]}"
git push origin --delete ${BATCH[@]} || echo "Failed to delete some branches in batch, continuing..."
done
echo "Branch deletion process complete"
- name: Create release
run: |
VERSION=${{ needs.prepare-release.outputs.release-version }}
Expand Down

0 comments on commit 9e6ddf2

Please sign in to comment.