Skip to content

Commit 1a9b7f0

Browse files
committed
Update code to ensure the new hotfix branch doesn't exist
1 parent 0d304a3 commit 1a9b7f0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

fastlane/Fastfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,9 +450,12 @@ platform :ios do
450450
# Fetch the base ref to ensure it's available locally
451451
sh('git', 'fetch', 'origin', base_ref_for_hotfix)
452452

453+
hotfix_branch = "release/#{version}"
454+
ensure_branch_does_not_exist!(hotfix_branch)
455+
453456
# Create the hotfix branch
454457
UI.message("Creating hotfix branch from '#{base_ref_for_hotfix}'...")
455-
Fastlane::Helper::GitHelper.create_branch("release/#{version}", from: base_ref_for_hotfix)
458+
Fastlane::Helper::GitHelper.create_branch(hotfix_branch, from: base_ref_for_hotfix)
456459
UI.success("Done! New hotfix branch is: '#{git_branch}'")
457460

458461
# Bump the hotfix version and build code and write it to the `xcconfig` file

0 commit comments

Comments
 (0)