File tree Expand file tree Collapse file tree 1 file changed +22
-6
lines changed Expand file tree Collapse file tree 1 file changed +22
-6
lines changed Original file line number Diff line number Diff line change @@ -202,11 +202,8 @@ platform :ios do
202202
203203 desc "Uploads DSYM files to Sentry"
204204 lane :upload_dsym_to_sentry do
205- auth_token = get_xcconfig_value (
206- path : 'Configs/Secrets.xcconfig' ,
207- name : 'SENTRY_DSYM_TOKEN'
208- )
209-
205+ auth_token = get_secret_value ( 'SENTRY_DSYM_TOKEN' )
206+
210207 sentry_debug_files_upload (
211208 auth_token : auth_token ,
212209 org_slug : 'forpda' ,
@@ -290,4 +287,23 @@ def print_lane_options(lane_name, options = {})
290287 default_str = value [ :default ] ? " (default: #{ value [ :default ] } )" : ""
291288 UI . message ( "• #{ key } : #{ value [ :description ] } #{ default_str } " )
292289 end
293- end
290+ end
291+
292+ def get_secret_value ( name )
293+ is_ci = ENV [ 'CI' ] == 'true'
294+
295+ if is_ci
296+ value = ENV [ name ]
297+ UI . message ( "Using #{ name } from environment (CI=true)" )
298+ else
299+ xcconfig_path = 'Configs/Secrets.local.xcconfig'
300+ value = get_xcconfig_value ( path : xcconfig_path , name : name )
301+ UI . message ( "Using #{ name } from #{ xcconfig_path } (CI=false)" )
302+ end
303+
304+ if value . nil? || value . empty?
305+ UI . user_error ( "Error: #{ name } is not set" )
306+ end
307+
308+ value
309+ end
You can’t perform that action at this time.
0 commit comments