Skip to content

Commit 402649a

Browse files
[CI] Get the correct target branch on public interface validation (#40)
1 parent e3c7350 commit 402649a

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
@@ -228,12 +228,15 @@ end
228228
lane :validate_public_interface do
229229
next unless is_check_required(sources: sources_matrix[:public_interface], force_check: @force_check)
230230

231-
# Run the analysis on the current branch
231+
# Get branch names
232232
original_branch = current_branch
233+
target_branch = ENV['GITHUB_BASE_REF'] || (original_branch.include?('release/') ? 'main' : 'develop')
234+
UI.important("Target branch: #{target_branch} 🕊️")
235+
236+
# Run the analysis on the current branch
233237
sh('interface-analyser analysis ../Sources/ public_interface_current.json')
234238

235239
# Checkout the target branch
236-
target_branch = original_branch.include?('release/') ? 'main' : 'develop'
237240
sh("git fetch origin #{target_branch}")
238241
sh("git checkout #{target_branch}")
239242

0 commit comments

Comments
 (0)