From c2f0afb4bd7f1d2f4e1d2400f1c29f211124a4d1 Mon Sep 17 00:00:00 2001 From: Bruno Lopes Date: Wed, 17 Sep 2025 22:38:24 -0300 Subject: [PATCH] gitlab: Fix master exception on branches check --- .gitlab/check_dead_branches.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab/check_dead_branches.sh b/.gitlab/check_dead_branches.sh index ec6ead25f5..2bbf6f4d2d 100644 --- a/.gitlab/check_dead_branches.sh +++ b/.gitlab/check_dead_branches.sh @@ -1,7 +1,7 @@ #!/bin/sh printf "\e[0Ksection_start:`date +%s`:branch_check[collapsed=false]\r\e[0KChecking for dead branches\n" -git branch -r | grep -v 'origin/HEAD' | grep -v "origin/$CI_COMMIT_SHA" | while IFS= read remote_branch; do +git branch -r | grep -v 'origin/HEAD' | grep -v "origin/$CI_DEFAULT_BRANCH" | while IFS= read remote_branch; do remote_branch=$(printf "%s\n" "$remote_branch" | sed 's/^ *//;s/ *$//') branch_name=$(printf "%s\n" "$remote_branch" | sed 's|origin/||') @@ -12,7 +12,7 @@ git branch -r | grep -v 'origin/HEAD' | grep -v "origin/$CI_COMMIT_SHA" | while continue fi ## Skip recently created branches - if [ "$(git rev-parse "$remote_branch")" = "$(git rev-parse "$CI_COMMIT_SHA")" ] && [ "$branch_name" != "$CI_DEFAULT_BRANCH" ]; then + if [ "$(git rev-parse "$remote_branch")" = "$(git rev-parse "$CI_COMMIT_SHA")" ]; then printf "\033[33m(SKIP)\033[0m: $branch_name is identical to $CI_DEFAULT_BRANCH but no problem\n" continue fi