Skip to content

Commit 25a6d86

Browse files
fix(): add check for existing tracking branch before creating hotfix PR (#1840)
1 parent b40c1d7 commit 25a6d86

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

.github/workflows/create-hotfix-pr.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,12 @@ jobs:
188188
189189
echo "::warning::Workflow file changes detected for ${base_branch}; creating manual hotfix tracking PR."
190190
191+
if git ls-remote --exit-code origin "refs/heads/$tracking_branch" >/dev/null 2>&1; then
192+
echo "::error::Tracking branch '$tracking_branch' already exists on remote. Delete it manually before re-running."
193+
push_failed="true"
194+
continue
195+
fi
196+
191197
git checkout "$base_branch"
192198
git branch -D "$new_branch"
193199
git checkout -b "$tracking_branch"

0 commit comments

Comments
 (0)