react-native-keys icon indicating copy to clipboard operation
react-native-keys copied to clipboard

Read env from Fastfile

Open detatsatrio opened this issue 1 year ago β€’ 2 comments

Hi Guys, is possible to read env from keys to fastfile for fastlane feature?

I've try with ENV["APPCENTER_KEY"] is not working yet, same way with react-native-config.

Thanks in advance

detatsatrio avatar May 15 '24 07:05 detatsatrio

πŸ‘‹ @detatsatrio Thanks for opening your issue here! If you find this package useful hit the star🌟!

github-actions[bot] avatar May 15 '24 07:05 github-actions[bot]

Hi Guys, is possible to read env from keys to fastfile for fastlane feature?

I've try with ENV["APPCENTER_KEY"] is not working yet, same way with react-native-config.

Thanks in advance

U can use this function to load env:

lane :load_env_from_json do |params|
  # Load environment variables from the JSON file
  json_data = JSON.parse(File.read(params[:file]))

  # Set the environment variables
  json_data.each do |key, value|
    json_data.each do |scope, values|
      values.each do |key, value|
        ENV["#{key}"] = value
      end
    end
  end
end

ngocle2497 avatar Jul 18 '24 04:07 ngocle2497