Class: Fastlane::Actions::IosCompletecodefreezePrechecksAction

Inherits:
Action
  • Object
show all
Defined in:
lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_completecodefreeze_prechecks.rb

Documentation collapse

Class Method Summary collapse

Class Method Details

.authorsObject



56
57
58
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_completecodefreeze_prechecks.rb', line 56

def self.authors
  ['Automattic']
end

.available_optionsObject



40
41
42
43
44
45
46
47
48
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_completecodefreeze_prechecks.rb', line 40

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :skip_confirm,
                                 env_name: 'FL_IOS_COMPLETECODEFREEZE_PRECHECKS_SKIPCONFIRM',
                                 description: 'Skips confirmation',
                                 type: Boolean,
                                 default_value: false), # the default value if the user didn't provide one
  ]
end

.descriptionObject



32
33
34
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_completecodefreeze_prechecks.rb', line 32

def self.description
  'Runs some prechecks before finalizing a code freeze'
end

.detailsObject



36
37
38
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_completecodefreeze_prechecks.rb', line 36

def self.details
  'Runs some prechecks before finalizing a code freeze'
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


60
61
62
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_completecodefreeze_prechecks.rb', line 60

def self.is_supported?(platform)
  %i[ios mac].include?(platform)
end

.outputObject



50
51
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_completecodefreeze_prechecks.rb', line 50

def self.output
end

.return_valueObject



53
54
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_completecodefreeze_prechecks.rb', line 53

def self.return_value
end

.run(params) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_completecodefreeze_prechecks.rb', line 4

def self.run(params)
  UI.message "Skip confirm: #{params[:skip_confirm]}"

  require_relative '../../helper/ios/ios_version_helper'
  require_relative '../../helper/ios/ios_git_helper'
  require_relative '../../helper/git_helper'

  current_branch = Fastlane::Helper::GitHelper.current_git_branch
  UI.user_error!("Current branch - '#{current_branch}' - is not a release branch. Abort.") unless current_branch.start_with?('release/')

  version = Fastlane::Helper::Ios::VersionHelper.get_public_version
  message = "Completing code freeze for: #{version}\n"
  if params[:skip_confirm]
    UI.message(message)
  else
    UI.user_error!('Aborted by user request') unless UI.confirm("#{message}Do you want to continue?")
  end

  # Check local repo status
  other_action.ensure_git_status_clean

  version
end