Skip to content

Commit a27d801

Browse files
committed
fix(ci): batch svn add/delete in groups of 500 to avoid limits
1 parent ec0d5dd commit a27d801

1 file changed

Lines changed: 24 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,30 @@ jobs:
180180
181181
# Stage changes in trunk only
182182
cd "${SVN_DIR}"
183-
svn add --force trunk --auto-props --parents --depth infinity -q 2>/dev/null || true
184-
svn status trunk | grep '^\!' | awk '{print $2}' | xargs -r svn delete --force -q
183+
184+
# Add new files in batches of 500 to avoid arg list / memory limits
185+
svn status trunk | grep '^\?' | awk '{print $2}' > /tmp/svn-new-files.txt
186+
NEW_COUNT=$(wc -l < /tmp/svn-new-files.txt)
187+
echo "New files to add: ${NEW_COUNT}"
188+
if [ "${NEW_COUNT}" -gt 0 ]; then
189+
split -l 500 /tmp/svn-new-files.txt /tmp/svn-batch-add-
190+
for batch in /tmp/svn-batch-add-*; do
191+
echo "Adding batch: $(wc -l < "$batch") files"
192+
xargs -r svn add --parents -q < "$batch"
193+
done
194+
fi
195+
196+
# Remove deleted files in batches
197+
svn status trunk | grep '^\!' | awk '{print $2}' > /tmp/svn-del-files.txt
198+
DEL_COUNT=$(wc -l < /tmp/svn-del-files.txt)
199+
echo "Deleted files to remove: ${DEL_COUNT}"
200+
if [ "${DEL_COUNT}" -gt 0 ]; then
201+
split -l 500 /tmp/svn-del-files.txt /tmp/svn-batch-del-
202+
for batch in /tmp/svn-batch-del-*; do
203+
echo "Deleting batch: $(wc -l < "$batch") files"
204+
xargs -r svn delete --force -q < "$batch"
205+
done
206+
fi
185207
186208
echo "=== SVN Status (trunk) ==="
187209
svn status trunk | head -50

0 commit comments

Comments
 (0)