Skip to content

Commit 6ea9106

Browse files
[CI] Check out the original branch after public interface validation (#857)
1 parent d6845b9 commit 6ea9106

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

fastlane/Fastfile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,11 +729,16 @@ lane :validate_public_interface do
729729
sh("wget -P . https://github.com/GetStream/stream-module-interface-analyser/releases/download/v1.0.7/interface-analyser")
730730
sh("chmod +x #{analyser}")
731731

732+
# Run the analysis on the current branch
733+
original_branch = current_branch
732734
sh("./#{analyser} analysis ../Sources/ ../public_interface_current.json")
733735

734-
target_branch = current_branch.include?('release/') ? 'main' : 'develop'
736+
# Checkout the target branch
737+
target_branch = original_branch.include?('release/') ? 'main' : 'develop'
735738
sh("git fetch origin #{target_branch}")
736739
sh("git checkout #{target_branch}")
740+
741+
# Run the analysis on the target branch
737742
sh("./#{analyser} analysis ../Sources/ ../public_interface_previous.json")
738743

739744
# Run diff
@@ -754,6 +759,9 @@ lane :validate_public_interface do
754759

755760
# Post PR comment if running in CI
756761
pr_comment(text: content, edit_last_comment_with_text: header) if is_ci
762+
763+
# Checkout the original branch
764+
sh("git checkout #{original_branch}")
757765
end
758766

759767
lane :show_frameworks_sizes do |options|

0 commit comments

Comments
 (0)