Skip to content

Commit 40f9662

Browse files
committed
fix(ci): only pass groups to upload_to_testflight when distributing externally
Passing the groups parameter with distribute_external=false still triggers the App Store Connect groups API, which fails with a forbidden error when the API key lacks external-distribution permissions. Omit groups from the options hash when not distributing. Made-with: Cursor
1 parent f0baacc commit 40f9662

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

ios/fastlane/Fastfile

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,20 @@ platform :ios do
9393
key_filepath: api_key_key_filepath,
9494
)
9595

96-
# Upload to TestFlight with API key from app_store_connect_api_key action
97-
upload_to_testflight(
96+
# Upload to TestFlight with API key from app_store_connect_api_key action.
97+
# Only include groups when distributing externally -- passing groups with
98+
# distribute_external=false still triggers the groups API, which fails if
99+
# the API key lacks external-distribution permissions.
100+
testflight_options = {
98101
api_key: api_key,
99102
ipa: ipa_path,
100103
distribute_external: distribute_external,
101-
groups: groups,
102104
notify_external_testers: notify_external_testers,
103105
changelog: changelog_message
104-
)
106+
}
107+
testflight_options[:groups] = groups if distribute_external
108+
109+
upload_to_testflight(testflight_options)
105110
end
106111
end
107112

0 commit comments

Comments
 (0)