From 6ed56d7fa75b0c83a5f3fe68b074236475e92031 Mon Sep 17 00:00:00 2001 From: Benjamin DeMann Date: Mon, 23 Dec 2024 21:39:39 -0700 Subject: [PATCH] handle no branches to delete --- .github/workflows/squash_branches.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/squash_branches.yml b/.github/workflows/squash_branches.yml index c3c6c5c505..cd9a331023 100644 --- a/.github/workflows/squash_branches.yml +++ b/.github/workflows/squash_branches.yml @@ -85,5 +85,9 @@ jobs: - name: Delete branches run: | - echo "Starting branch deletion process..." - git push origin --delete ${{ steps.collect-branches.outputs.branches }} + if [ -n "$(echo ${{ steps.collect-branches.outputs.branches }} | tr -d '[:space:]')" ]; then + echo "Starting branch deletion process..." + git push origin --delete ${{ steps.collect-branches.outputs.branches }} + else + echo "No branches to delete" + fi