-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathandroid_completecodefreeze_prechecks.rb
More file actions
70 lines (56 loc) · 2.13 KB
/
android_completecodefreeze_prechecks.rb
File metadata and controls
70 lines (56 loc) · 2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
module Fastlane
module Actions
class AndroidCompletecodefreezePrechecksAction < Action
def self.run(params)
UI.message "Skip confirm: #{params[:skip_confirm]}"
require_relative '../../helper/android/android_version_helper'
require_relative '../../helper/android/android_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::Android::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
#####################################################
# @!group Documentation
#####################################################
def self.description
'Runs some prechecks before finalizing a code freeze'
end
def self.details
'Runs some prechecks before finalizing a code freeze'
end
def self.available_options
[
FastlaneCore::ConfigItem.new(key: :skip_confirm,
env_name: 'FL_ANDROID_COMPLETECODEFREEZE_PRECHECKS_SKIPCONFIRM',
description: 'Skips confirmation',
type: Boolean,
default_value: false), # the default value if the user didn't provide one
]
end
def self.output
end
def self.return_type
:string
end
def self.return_value
'The version number that has been prechecked.'
end
def self.authors
['Automattic']
end
def self.is_supported?(platform)
platform == :android
end
end
end
end