From: Patrick Donnelly Date: Tue, 11 Feb 2025 16:06:33 +0000 (-0500) Subject: script/clean-ci: do not push if there is nothing to delete X-Git-Tag: v20.0.0~190^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=2804a59a744b03b1c70e7c8c4d35ceac2de8002c;p=ceph.git script/clean-ci: do not push if there is nothing to delete Signed-off-by: Patrick Donnelly --- diff --git a/src/script/clean-ci b/src/script/clean-ci index d5df15a0b6548..5a2b84c8493ce 100755 --- a/src/script/clean-ci +++ b/src/script/clean-ci @@ -19,11 +19,13 @@ function eprintf { function delete_refs { - if [[ DRY_RUN -eq 0 ]]; then - eprintf 'Deleting refs: %s' "$*" - git push --quiet "$CEPH_CI" --delete "$@" - else - eprintf 'Would delete refs: %s' "$*" + if [[ ${#TO_DELETE[@]} -gt 0 ]]; then + if [[ DRY_RUN -eq 0 ]]; then + eprintf 'Deleting refs: %s' "$*" + git push --quiet "$REMOTE" --delete "$@" + else + eprintf 'Would delete refs: %s' "$*" + fi fi }