@@ -186,7 +186,8 @@ jobs:
186186 cd "${SVN_DIR}"
187187
188188 # Add new files in batches of 500 to avoid arg list / memory limits
189- svn status trunk | grep '^\?' | awk '{print $2}' > /tmp/svn-new-files.txt
189+ # Use '|| true' to prevent grep returning exit 1 (no match) from killing the script under pipefail
190+ svn status trunk | grep '^\?' | awk '{print $2}' > /tmp/svn-new-files.txt || true
190191 NEW_COUNT=$(wc -l < /tmp/svn-new-files.txt)
191192 echo "New files to add: ${NEW_COUNT}"
192193 if [ "${NEW_COUNT}" -gt 0 ]; then
@@ -198,7 +199,7 @@ jobs:
198199 fi
199200
200201 # Remove deleted files in batches
201- svn status trunk | grep '^\!' | awk '{print $2}' > /tmp/svn-del-files.txt
202+ svn status trunk | grep '^\!' | awk '{print $2}' > /tmp/svn-del-files.txt || true
202203 DEL_COUNT=$(wc -l < /tmp/svn-del-files.txt)
203204 echo "Deleted files to remove: ${DEL_COUNT}"
204205 if [ "${DEL_COUNT}" -gt 0 ]; then
@@ -210,20 +211,24 @@ jobs:
210211 fi
211212
212213 echo "=== SVN Status (trunk) ==="
213- svn status trunk > /tmp/svn-status.txt
214+ svn status trunk > /tmp/svn-status.txt || true
214215 head -50 /tmp/svn-status.txt
215216 CHANGES=$(wc -l < /tmp/svn-status.txt)
216217 echo "Total trunk changes: ${CHANGES}"
217218
218219 if [ "${CHANGES}" -eq 0 ]; then
219220 echo "No changes to commit to trunk"
220221 else
222+ echo "Committing ${CHANGES} changes to WordPress.org SVN..."
221223 svn commit \
222224 --username "${SVN_USERNAME}" \
223225 --password "${SVN_PASSWORD}" \
224226 --no-auth-cache \
225227 --non-interactive \
226- -m "Update trunk to ${VERSION}"
228+ -m "Update trunk to ${VERSION}" 2>&1 || {
229+ echo "::error::SVN commit failed. Check SVN_USERNAME and SVN_PASSWORD secrets."
230+ exit 1
231+ }
227232 echo "Trunk committed successfully"
228233 fi
229234
0 commit comments