From 2804a59a744b03b1c70e7c8c4d35ceac2de8002c Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Tue, 11 Feb 2025 11:06:33 -0500 Subject: [PATCH] script/clean-ci: do not push if there is nothing to delete Signed-off-by: Patrick Donnelly --- src/script/clean-ci | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/script/clean-ci b/src/script/clean-ci index d5df15a0b65..5a2b84c8493 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 } -- 2.39.5