Skip to content

Commit 1f79171

Browse files
committed
Update code to ensure the new hotfix branch doesn't exist
1 parent f191830 commit 1f79171

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

fastlane/lanes/release.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,12 @@
250250
# Fetch the base ref to ensure it's available locally
251251
sh('git', 'fetch', 'origin', base_ref_for_hotfix)
252252

253+
hotfix_branch = "release/#{new_version}"
254+
ensure_branch_does_not_exist!(hotfix_branch)
255+
253256
# Create the hotfix branch
254257
UI.message("Creating hotfix branch from '#{base_ref_for_hotfix}'...")
255-
Fastlane::Helper::GitHelper.create_branch("release/#{new_version}", from: base_ref_for_hotfix)
258+
Fastlane::Helper::GitHelper.create_branch(hotfix_branch, from: base_ref_for_hotfix)
256259
UI.success("Done! New hotfix branch is: '#{git_branch}'")
257260

258261
# Bump the hotfix version and build code and write it to the `version.properties` file

0 commit comments

Comments
 (0)