Class: Fastlane::Actions::ReadFastlaneSessionAction

Inherits:
Action
  • Object
show all
Defined in:
lib/fastlane/plugin/react_native_release/actions/read_fastlane_session.rb

Class Method Summary collapse

Class Method Details

.authorsObject



35
36
37
# File 'lib/fastlane/plugin/react_native_release/actions/read_fastlane_session.rb', line 35

def self.authors
  ["cball", "isaiahgrey93"]
end

.descriptionObject



31
32
33
# File 'lib/fastlane/plugin/react_native_release/actions/read_fastlane_session.rb', line 31

def self.description
  "Simplify 2FA authentication for App Store Connect"
end

.detailsObject



43
44
45
# File 'lib/fastlane/plugin/react_native_release/actions/read_fastlane_session.rb', line 43

def self.details
  "Fetches an encrypted cookie for authenticating with App Store connecting. Handles fetching and decrypting the cookie before setting to the local env."
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


47
48
49
50
51
52
# File 'lib/fastlane/plugin/react_native_release/actions/read_fastlane_session.rb', line 47

def self.is_supported?(platform)
  # Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example)
  # See: https://docs.fastlane.tools/advanced/#control-configuration-by-lane-and-by-platform
  #
  [:ios, :android].include?(platform)
end

.return_valueObject



39
40
41
# File 'lib/fastlane/plugin/react_native_release/actions/read_fastlane_session.rb', line 39

def self.return_value
  # If your method provides a return value, you can describe here what it does
end

.run(params) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/fastlane/plugin/react_native_release/actions/read_fastlane_session.rb', line 7

def self.run(params)
  key = Helper::ReactNativeReleaseHelper::FASTLANE_SESSION_CRYPTEX_KEY
  fastlane_session_git_url =  ENV["CRYPTEX_GIT_URL"]
  fastlane_session_password = ENV["CRYPTEX_PASSWORD"]
  fastlane_session_cookie_path = Tempfile.new('')

  UI.message "Reading fastlane session.."

  other_action.cryptex(
    type: "export",
    out: fastlane_session_cookie_path.path,
    key: key,
  )

  fastlane_session = (open fastlane_session_cookie_path.path).read

  UI.message fastlane_session_cookie_path.path
  UI.message fastlane_session

  ENV["FASTLANE_SESSION"] = fastlane_session

  UI.success "Read FASTLANE_SESSION from remote repository."
end