Skip to content

Commit ff4977d

Browse files
[CI] Get the correct target branch on public interface validation (#994)
1 parent aadde08 commit ff4977d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

fastlane/Fastfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -563,12 +563,15 @@ end
563563
lane :validate_public_interface do
564564
next unless is_check_required(sources: sources_matrix[:public_interface], force_check: @force_check)
565565

566-
# Run the analysis on the current branch
566+
# Get branch names
567567
original_branch = current_branch
568+
target_branch = ENV['GITHUB_BASE_REF'] || (original_branch.include?('release/') ? 'main' : 'develop')
569+
UI.important("Target branch: #{target_branch} 🕊️")
570+
571+
# Run the analysis on the current branch
568572
sh('interface-analyser analysis ../Sources/ public_interface_current.json')
569573

570574
# Checkout the target branch
571-
target_branch = original_branch.include?('release/') ? 'main' : 'develop'
572575
sh("git fetch origin #{target_branch}")
573576
sh("git checkout #{target_branch}")
574577

0 commit comments

Comments
 (0)