Skip to content

Commit

Permalink
Get branch
Browse files Browse the repository at this point in the history
  • Loading branch information
testableapple committed Mar 8, 2024
1 parent 793e29e commit bfbe384
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,20 @@ private_lane :create_pr do |options|
end

private_lane :current_branch do
ENV['BRANCH_NAME'].to_s.empty? ? git_branch : ENV.fetch('BRANCH_NAME')
github_pr_branch_name = ENV['BRANCH_NAME'].to_s
github_ref_branch_name = ENV['GITHUB_REF'].to_s.sub('refs/heads/', '')
fastlane_branch_name = git_branch

branch_name = if !github_pr_branch_name.empty?
github_pr_branch_name
elsif !fastlane_branch_name.empty?
fastlane_branch_name
elsif !github_ref_branch_name.empty?
github_ref_branch_name
end

UI.important("Current branch: #{branch_name} 🕊️")
branch_name
end

private_lane :git_status do |options|
Expand Down

0 comments on commit bfbe384

Please sign in to comment.