From b7bd97e40d6d072fcb2f1188fa731aaf4e712583 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lison=20Fernandes?= Date: Wed, 18 Dec 2024 22:55:17 +0000 Subject: [PATCH] Check if hotfix branch already exists --- .github/workflows/release-branch.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/release-branch.yml b/.github/workflows/release-branch.yml index 96e336940f6..4d279ce2211 100644 --- a/.github/workflows/release-branch.yml +++ b/.github/workflows/release-branch.yml @@ -52,6 +52,10 @@ jobs: exit 1 fi branch_name="release/hotfix-${latest_tag}" + if git show-ref --quiet refs/heads/$branch_name; then + echo "# :fire: :warning: Hotfix branch already exists: ${branch_name}" >> $GITHUB_STEP_SUMMARY + exit 0 + fi git switch -c $branch_name $latest_tag git push origin $branch_name echo "# :fire: Hotfix branch: ${branch_name}" >> $GITHUB_STEP_SUMMARY