Skip to content

Commit 36e0af5

Browse files
authored
Use AccountManager to require user in register_new_device (#7522)
2 parents 43ab0aa + 655e0dd commit 36e0af5

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

fastlane/Fastfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,17 @@ platform :ios do
596596
)
597597
end
598598

599+
# We're about to use `add_development_certificates_to_provisioning_profiles` and `add_all_devices_to_provisioning_profiles`.
600+
# These actions use Developer Portal APIs that don't yet support authentication via API key (-.-').
601+
# Let's preemptively ask for and set the email here to avoid being asked twice for it if not set.
602+
603+
require 'credentials_manager'
604+
605+
# If Fastlane cannot instantiate a user, it will ask the caller for the email.
606+
# Once we have it, we can set it as `FASTLANE_USER` in the environment (which has lifecycle limited to this call) so that the next commands will already have access to it.
607+
# Note that if the user is already available to `AccountManager`, setting it in the environment is redundant, but Fastlane doesn't provide a way to check it so we have to do it anyway.
608+
ENV['FASTLANE_USER'] = CredentialsManager::AccountManager.new.user
609+
599610
# Add all development certificates to the provisioning profiles (just in case – this is an easy step to miss)
600611
add_development_certificates_to_provisioning_profiles(
601612
team_id: get_required_env('EXT_EXPORT_TEAM_ID'),

0 commit comments

Comments
 (0)