Skip to content

Commit 291fa41

Browse files
[CI] Get the correct target branch on public interface validation (#960)
1 parent e35f667 commit 291fa41

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
@@ -726,12 +726,15 @@ end
726726
lane :validate_public_interface do
727727
next unless is_check_required(sources: sources_matrix[:public_interface], force_check: @force_check)
728728

729-
# Run the analysis on the current branch
729+
# Get branch names
730730
original_branch = current_branch
731+
target_branch = ENV['GITHUB_BASE_REF'] || (original_branch.include?('release/') ? 'main' : 'develop')
732+
UI.important("Target branch: #{target_branch} 🕊️")
733+
734+
# Run the analysis on the current branch
731735
sh('interface-analyser analysis ../Sources/ public_interface_current.json')
732736

733737
# Checkout the target branch
734-
target_branch = original_branch.include?('release/') ? 'main' : 'develop'
735738
sh("git fetch origin #{target_branch}")
736739
sh("git checkout #{target_branch}")
737740

0 commit comments

Comments
 (0)