Exclude internal groups from TestFlight distribution

ASC now rejects assigning builds to internal groups explicitly
(they get access to new builds automatically), which failed all
beta lanes at upload_to_testflight.
This commit is contained in:
Arkadiusz Fal
2026-07-27 08:31:04 +02:00
parent 296779c63a
commit 5c94526961

View File

@@ -40,7 +40,9 @@ def all_testflight_group_names(api_key)
Spaceship::ConnectAPI.token = Spaceship::ConnectAPI::Token.from(hash: api_key) Spaceship::ConnectAPI.token = Spaceship::ConnectAPI::Token.from(hash: api_key)
app = Spaceship::ConnectAPI::App.find(DEVELOPER_APP_IDENTIFIER) app = Spaceship::ConnectAPI::App.find(DEVELOPER_APP_IDENTIFIER)
UI.user_error!("App #{DEVELOPER_APP_IDENTIFIER} not found on App Store Connect") if app.nil? UI.user_error!("App #{DEVELOPER_APP_IDENTIFIER} not found on App Store Connect") if app.nil?
groups = app.get_beta_groups.map(&:name) # Internal groups can't be assigned builds via the API (ASC rejects it);
# they get access to new builds automatically anyway.
groups = app.get_beta_groups.reject(&:is_internal_group).map(&:name)
UI.user_error!("No TestFlight beta groups found for #{DEVELOPER_APP_IDENTIFIER}") if groups.empty? UI.user_error!("No TestFlight beta groups found for #{DEVELOPER_APP_IDENTIFIER}") if groups.empty?
UI.message("Distributing build to TestFlight groups: #{groups.join(', ')}") UI.message("Distributing build to TestFlight groups: #{groups.join(', ')}")
groups groups