From a83ddba7b7f0a4a62b5eb78c5a545914c24b2973 Mon Sep 17 00:00:00 2001 From: Alexey Alter-Pesotskiy Date: Fri, 3 Oct 2025 14:58:48 +0100 Subject: [PATCH] [CI] Get the correct target branch on public interface validation --- fastlane/Fastfile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index c981ac7..2b7005a 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -231,12 +231,15 @@ end lane :validate_public_interface do next unless is_check_required(sources: sources_matrix[:public_interface], force_check: @force_check) - # Run the analysis on the current branch + # Get branch names original_branch = current_branch + target_branch = ENV['GITHUB_BASE_REF'] || (original_branch.include?('release/') ? 'main' : 'develop') + UI.important("Target branch: #{target_branch} 🕊️") + + # Run the analysis on the current branch sh('interface-analyser analysis ../Sources/ public_interface_current.json') # Checkout the target branch - target_branch = original_branch.include?('release/') ? 'main' : 'develop' sh("git fetch origin #{target_branch}") sh("git checkout #{target_branch}")