pantograph 0.1.14 → 0.1.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/pantograph/lib/assets/custom_action_template.rb +18 -14
  4. data/pantograph/lib/pantograph/action.rb +1 -1
  5. data/pantograph/lib/pantograph/action_collector.rb +1 -1
  6. data/pantograph/lib/pantograph/actions/actions_helper.rb +2 -2
  7. data/pantograph/lib/pantograph/actions/bundle_install.rb +120 -84
  8. data/pantograph/lib/pantograph/actions/cloc.rb +64 -49
  9. data/pantograph/lib/pantograph/actions/create_pull_request.rb +1 -1
  10. data/pantograph/lib/pantograph/actions/danger.rb +103 -82
  11. data/pantograph/lib/pantograph/actions/debug.rb +2 -2
  12. data/pantograph/lib/pantograph/actions/default_platform.rb +5 -3
  13. data/pantograph/lib/pantograph/actions/download.rb +10 -9
  14. data/pantograph/lib/pantograph/actions/echo.rb +1 -1
  15. data/pantograph/lib/pantograph/actions/ensure_bundle_exec.rb +18 -10
  16. data/pantograph/lib/pantograph/actions/ensure_env_vars.rb +16 -17
  17. data/pantograph/lib/pantograph/actions/ensure_git_branch.rb +14 -14
  18. data/pantograph/lib/pantograph/actions/ensure_git_status_clean.rb +18 -34
  19. data/pantograph/lib/pantograph/actions/get_github_release.rb +1 -1
  20. data/pantograph/lib/pantograph/actions/git_branch.rb +6 -7
  21. data/pantograph/lib/pantograph/actions/git_commit.rb +21 -13
  22. data/pantograph/lib/pantograph/actions/git_pull.rb +4 -23
  23. data/pantograph/lib/pantograph/actions/git_pull_tags.rb +31 -0
  24. data/pantograph/lib/pantograph/actions/git_submodule_update.rb +23 -16
  25. data/pantograph/lib/pantograph/actions/git_tag_exists.rb +21 -25
  26. data/pantograph/lib/pantograph/actions/gradle.rb +82 -58
  27. data/pantograph/lib/pantograph/actions/import.rb +1 -1
  28. data/pantograph/lib/pantograph/actions/import_from_git.rb +48 -31
  29. data/pantograph/lib/pantograph/actions/is_ci.rb +1 -1
  30. data/pantograph/lib/pantograph/actions/is_verbose.rb +77 -0
  31. data/pantograph/lib/pantograph/actions/jira.rb +50 -55
  32. data/pantograph/lib/pantograph/actions/lane_context.rb +6 -6
  33. data/pantograph/lib/pantograph/actions/last_git_commit.rb +3 -3
  34. data/pantograph/lib/pantograph/actions/min_pantograph_version.rb +19 -25
  35. data/pantograph/lib/pantograph/actions/number_of_commits.rb +34 -30
  36. data/pantograph/lib/pantograph/actions/opt_out_usage.rb +15 -9
  37. data/pantograph/lib/pantograph/actions/pantograph_version.rb +2 -2
  38. data/pantograph/lib/pantograph/actions/println.rb +1 -1
  39. data/pantograph/lib/pantograph/actions/prompt.rb +31 -22
  40. data/pantograph/lib/pantograph/actions/prompt_secure.rb +128 -0
  41. data/pantograph/lib/pantograph/actions/reset_git_repo.rb +1 -1
  42. data/pantograph/lib/pantograph/actions/set_github_release.rb +4 -4
  43. data/pantograph/lib/pantograph/actions/sh.rb +3 -3
  44. data/pantograph/lib/pantograph/commands_generator.rb +1 -1
  45. data/pantograph/lib/pantograph/helper/git_helper.rb +29 -0
  46. data/pantograph/lib/pantograph/lane_manager.rb +1 -1
  47. data/pantograph/lib/pantograph/pant_file.rb +22 -16
  48. data/pantograph/lib/pantograph/plugins/template/README.md.erb +1 -1
  49. data/pantograph/lib/pantograph/setup/setup.rb +6 -17
  50. data/pantograph/lib/pantograph/version.rb +1 -1
  51. data/pantograph_core/lib/pantograph_core/configuration/commander_generator.rb +1 -1
  52. data/pantograph_core/lib/pantograph_core/globals.rb +1 -2
  53. data/pantograph_core/lib/pantograph_core/helper.rb +19 -6
  54. data/pantograph_core/lib/pantograph_core/ui/implementations/shell.rb +1 -4
  55. metadata +19 -5
  56. data/pantograph/lib/pantograph/actions/git_add.rb +0 -93
  57. data/pantograph/lib/pantograph/actions/make_changelog_from_jenkins.rb +0 -81
  58. data/pantograph/lib/pantograph/actions/nexus_upload.rb +0 -230
@@ -5,26 +5,19 @@ module Pantograph
5
5
  Actions.verify_gem!('jira-ruby')
6
6
  require 'jira-ruby'
7
7
 
8
- site = params[:url]
9
- auth_type = :basic
10
- context_path = params[:context_path]
11
- username = params[:username]
12
- password = params[:password]
13
- ticket_id = params[:ticket_id]
14
- comment_text = params[:comment_text]
8
+ client = JIRA::Client.new(
9
+ {
10
+ site: params[:url],
11
+ context_path: params[:context_path],
12
+ auth_type: :basic,
13
+ username: params[:username],
14
+ password: params[:password]
15
+ }
16
+ )
15
17
 
16
- options = {
17
- site: site,
18
- context_path: context_path,
19
- auth_type: auth_type,
20
- username: username,
21
- password: password
22
- }
23
-
24
- client = JIRA::Client.new(options)
25
- issue = client.Issue.find(ticket_id)
18
+ issue = client.Issue.find(params[:ticket_id])
26
19
  comment = issue.comments.build
27
- comment.save({ 'body' => comment_text })
20
+ comment.save({ 'body' => params[:comment_text] })
28
21
  end
29
22
 
30
23
  #####################################################
@@ -32,47 +25,49 @@ module Pantograph
32
25
  #####################################################
33
26
 
34
27
  def self.description
35
- "Leave a comment on JIRA tickets"
28
+ 'Leave a comment on JIRA tickets'
36
29
  end
37
30
 
38
31
  def self.available_options
39
32
  [
40
- PantographCore::ConfigItem.new(key: :url,
41
- env_name: 'JIRA_SITE',
42
- description: 'URL for Jira instance',
43
- verify_block: proc do |value|
44
- UI.user_error!("No url for Jira given, pass using `url: 'url'`") if value.to_s.length == 0
45
- end),
46
- PantographCore::ConfigItem.new(key: :context_path,
47
- env_name: 'JIRA_CONTEXT_PATH',
48
- description: "Appends to the url (ex: \"/jira\")",
49
- optional: true,
50
- default_value: ""),
51
- PantographCore::ConfigItem.new(key: :username,
52
- env_name: 'JIRA_USERNAME',
53
- description: 'Username for JIRA instance',
54
- verify_block: proc do |value|
55
- UI.user_error!('No username') if value.to_s.length == 0
56
- end),
57
- PantographCore::ConfigItem.new(key: :password,
58
- env_name: 'JIRA_PASSWORD',
59
- description: 'Password for Jira',
60
- sensitive: true,
61
- verify_block: proc do |value|
62
- UI.user_error!("No password") if value.to_s.length == 0
63
- end),
64
- PantographCore::ConfigItem.new(key: :ticket_id,
65
- env_name: 'JIRA_TICKET_ID',
66
- description: 'Ticket ID for Jira, i.e. APP-123',
67
- verify_block: proc do |value|
68
- UI.user_error!("No Ticket specified") if value.to_s.length == 0
69
- end),
70
- PantographCore::ConfigItem.new(key: :comment_text,
71
- env_name: 'JIRA_COMMENT_TEXT',
72
- description: 'Text to add to the ticket as a comment',
73
- verify_block: proc do |value|
74
- UI.user_error!('No comment specified') if value.to_s.length == 0
75
- end)
33
+ PantographCore::ConfigItem.new(
34
+ key: :url,
35
+ env_name: 'JIRA_SITE',
36
+ description: 'URL for Jira instance',
37
+ optional: false
38
+ ),
39
+ PantographCore::ConfigItem.new(
40
+ key: :context_path,
41
+ env_name: 'JIRA_CONTEXT_PATH',
42
+ description: "Appends to the url (ex: \"/jira\")",
43
+ optional: true,
44
+ default_value: ''
45
+ ),
46
+ PantographCore::ConfigItem.new(
47
+ key: :username,
48
+ env_name: 'JIRA_USERNAME',
49
+ description: 'Username for JIRA instance',
50
+ optional: false
51
+ ),
52
+ PantographCore::ConfigItem.new(
53
+ key: :password,
54
+ env_name: 'JIRA_PASSWORD',
55
+ description: 'Password for Jira',
56
+ sensitive: true,
57
+ optional: false
58
+ ),
59
+ PantographCore::ConfigItem.new(
60
+ key: :ticket_id,
61
+ env_name: 'JIRA_TICKET_ID',
62
+ description: 'Ticket ID for Jira, i.e. APP-123',
63
+ optional: false
64
+ ),
65
+ PantographCore::ConfigItem.new(
66
+ key: :comment_text,
67
+ env_name: 'JIRA_COMMENT_TEXT',
68
+ description: 'Text to add to the ticket as a comment',
69
+ optional: false
70
+ )
76
71
  ]
77
72
  end
78
73
 
@@ -10,14 +10,14 @@ module Pantograph
10
10
  #####################################################
11
11
 
12
12
  def self.description
13
- "Access lane context values"
13
+ 'Access lane context values'
14
14
  end
15
15
 
16
16
  def self.details
17
17
  [
18
- "Access the pantograph lane context values.",
19
- "More information about how the lane context works: [https://johnknapprs.github.io/pantograph/advanced/#lane-context](https://johnknapprs.github.io/pantograph/advanced/#lane-context)."
20
- ].join("\n")
18
+ 'More information about how the lane context works:',
19
+ '[https://johnknapprs.github.io/pantograph/advanced/#lane-context](https://johnknapprs.github.io/pantograph/advanced/#lane-context)'
20
+ ].join(' ')
21
21
  end
22
22
 
23
23
  def self.available_options
@@ -33,7 +33,7 @@ module Pantograph
33
33
  end
34
34
 
35
35
  def self.authors
36
- ["KrauseFx"]
36
+ ['KrauseFx']
37
37
  end
38
38
 
39
39
  def self.is_supported?(platform)
@@ -47,7 +47,7 @@ module Pantograph
47
47
 
48
48
  def self.example_code
49
49
  [
50
- 'lane_context[SharedValues::BUILD_NUMBER]',
50
+ 'lane_context[:BUILD_NUMBER]',
51
51
  'lane_context[SharedValues::IPA_OUTPUT_PATH]'
52
52
  ]
53
53
  end
@@ -10,7 +10,7 @@ module Pantograph
10
10
  #####################################################
11
11
 
12
12
  def self.description
13
- "Return last git commit hash, abbreviated commit hash, commit message and author"
13
+ 'Return last git commit hash, abbreviated commit hash, commit message and author'
14
14
  end
15
15
 
16
16
  def self.return_value
@@ -21,8 +21,8 @@ module Pantograph
21
21
  :hash_of_strings
22
22
  end
23
23
 
24
- def self.author
25
- "ngutman"
24
+ def self.authors
25
+ ['ngutman', 'johnknapprs']
26
26
  end
27
27
 
28
28
  def self.is_supported?(platform)
@@ -1,57 +1,51 @@
1
1
  module Pantograph
2
2
  module Actions
3
- module SharedValues
4
- end
5
-
6
3
  class MinPantographVersionAction < Action
7
4
  def self.run(params)
8
- params = nil unless params.kind_of?(Array)
9
- value = (params || []).first
10
- defined_version = Gem::Version.new(value) if value
11
-
12
- UI.user_error!("Please pass minimum pantograph version as parameter to min_pantograph_version") unless defined_version
5
+ begin
6
+ defined_version = Gem::Version.new(params.first)
7
+ rescue
8
+ UI.user_error!('Please provide minimum pantograph version')
9
+ end
13
10
 
14
11
  if Gem::Version.new(Pantograph::VERSION) < defined_version
15
12
  PantographCore::UpdateChecker.show_update_message('pantograph', Pantograph::VERSION)
16
13
  error_message = "The Pantfile requires a pantograph version of >= #{defined_version}. You are on #{Pantograph::VERSION}."
17
14
  UI.user_error!(error_message)
15
+ else
16
+ UI.success("Your pantograph version #{Pantograph::VERSION} matches the minimum requirement of #{defined_version} ✅")
18
17
  end
18
+ end
19
19
 
20
- UI.message("Your pantograph version #{Pantograph::VERSION} matches the minimum requirement of #{defined_version} ✅")
20
+ def self.description
21
+ 'Verifies the minimum pantograph version required'
21
22
  end
22
23
 
23
- def self.step_text
24
- "Verifying pantograph version"
24
+ def self.details
25
+ 'Add this to your `Pantfile` to require a certain version of _pantograph_.'
25
26
  end
26
27
 
27
- def self.author
28
- "KrauseFx"
28
+ def self.authors
29
+ ['KrauseFx', 'johnknapprs']
29
30
  end
30
31
 
31
- def self.description
32
- "Verifies the minimum pantograph version required"
32
+ def self.is_supported?(platform)
33
+ true
33
34
  end
34
35
 
35
36
  def self.example_code
36
37
  [
37
- 'min_pantograph_version("1.50.0")'
38
+ 'min_pantograph_version("0.14.0")'
38
39
  ]
39
40
  end
40
41
 
41
- def self.details
42
- [
43
- "Add this to your `Pantfile` to require a certain version of _pantograph_.",
44
- "Use it if you use an action that just recently came out and you need it."
45
- ].join("\n")
42
+ def self.step_text
43
+ 'Verifying pantograph version'
46
44
  end
47
45
 
48
46
  def self.category
49
47
  :misc
50
48
  end
51
-
52
- def self.is_supported?(platform)
53
- true
54
- end
55
49
  end
56
50
  end
57
51
  end
@@ -1,24 +1,17 @@
1
1
  module Pantograph
2
2
  module Actions
3
- class NumberOfCommitsAction < Action
4
- def self.is_git?
5
- Actions.sh('git rev-parse HEAD')
6
- return true
7
- rescue
8
- return false
9
- end
3
+ module SharedValues
4
+ NUMBER_OF_COMMITS = :NUMBER_OF_COMMITS
5
+ end
10
6
 
7
+ class NumberOfCommitsAction < Action
11
8
  def self.run(params)
12
- if is_git?
13
- if params[:all]
14
- command = 'git rev-list --all --count'
15
- else
16
- command = 'git rev-list HEAD --count'
17
- end
18
- else
19
- UI.user_error!("Not in a git repository.")
20
- end
21
- return Actions.sh(command).strip.to_i
9
+ Pantograph::Helper::Git.is_git?
10
+
11
+ type = params[:all] ? '--all' : 'HEAD'
12
+ commits = Actions.sh("git rev-list #{type} --count").strip.to_i
13
+
14
+ Actions.lane_context[:NUMBER_OF_COMMITS] = commits
22
15
  end
23
16
 
24
17
  #####################################################
@@ -29,8 +22,7 @@ module Pantograph
29
22
  'Return the number of commits in current git branch'
30
23
  end
31
24
 
32
- def self.return_value
33
- 'The total number of all commits in current git branch'
25
+ def self.details
34
26
  end
35
27
 
36
28
  def self.return_type
@@ -39,20 +31,28 @@ module Pantograph
39
31
 
40
32
  def self.available_options
41
33
  [
42
- PantographCore::ConfigItem.new(key: :all,
43
- env_name: 'NUMBER_OF_COMMITS_ALL',
44
- optional: true,
45
- is_string: false,
46
- description: 'Returns number of all commits instead of current branch')
34
+ PantographCore::ConfigItem.new(
35
+ key: :all,
36
+ env_name: 'NUMBER_OF_COMMITS_ALL',
37
+ optional: true,
38
+ is_string: false,
39
+ description: 'Returns number of all commits instead of current branch'
40
+ )
47
41
  ]
48
42
  end
49
43
 
50
- def self.details
51
- 'You can use this action to get the number of commits of this branch. This is useful if you want to set the build number to the number of commits. See `pantograph actions number_of_commits` for more details.'
44
+ def self.return_value
45
+ 'The total number of all commits in current git branch'
46
+ end
47
+
48
+ def self.output
49
+ [
50
+ 'NUMBER_OF_COMMITS', 'Total number of git commits'
51
+ ]
52
52
  end
53
53
 
54
54
  def self.authors
55
- ['onevcat', 'samuelbeek']
55
+ ['onevcat', 'samuelbeek', 'johnknapprs']
56
56
  end
57
57
 
58
58
  def self.is_supported?(platform)
@@ -61,9 +61,13 @@ module Pantograph
61
61
 
62
62
  def self.example_code
63
63
  [
64
- 'increment_build_number(build_number: number_of_commits)',
65
- 'build_number = number_of_commits(all: true)
66
- increment_build_number(build_number: build_number)'
64
+ '
65
+ ENV["VERSION_NAME"] = number_of_commits
66
+ ',
67
+ '
68
+ build_number = number_of_commits(all: true)
69
+ increment_build_number(build_number: build_number)
70
+ '
67
71
  ]
68
72
  end
69
73
 
@@ -2,24 +2,24 @@ module Pantograph
2
2
  module Actions
3
3
  class OptOutUsageAction < Action
4
4
  def self.run(params)
5
- ENV['PANTOGRAPH_OPT_OUT_USAGE'] = "YES"
6
- UI.message("Disabled upload of used actions")
5
+ ENV['PANTOGRAPH_OPT_OUT_USAGE'] = 'YES'
6
+ UI.message('Disabled upload of used actions')
7
7
  end
8
8
 
9
9
  def self.description
10
- "This will stop uploading the information which actions were run"
10
+ 'This will stop uploading the information which actions were run'
11
11
  end
12
12
 
13
13
  def self.details
14
14
  [
15
- "By default, _pantograph_ will track what actions are being used. No personal/sensitive information is recorded.",
16
- "Learn more at [https://johnknapprs.github.io/pantograph/#metrics](https://johnknapprs.github.io/pantograph/#metrics).",
17
- "Add `opt_out_usage` at the top of your Pantfile to disable metrics collection."
15
+ 'By default, _pantograph_ will track what actions are being used. No personal/sensitive information is recorded.',
16
+ 'Learn more at [https://johnknapprs.github.io/pantograph/#metrics](https://johnknapprs.github.io/pantograph/#metrics).',
17
+ 'Add `opt_out_usage` at the top of your Pantfile to disable metrics collection.'
18
18
  ].join("\n")
19
19
  end
20
20
 
21
- def self.author
22
- "KrauseFx"
21
+ def self.authors
22
+ ['KrauseFx']
23
23
  end
24
24
 
25
25
  def self.is_supported?(platform)
@@ -28,10 +28,16 @@ module Pantograph
28
28
 
29
29
  def self.example_code
30
30
  [
31
- 'opt_out_usage # add this to the top of your Pantfile'
31
+ ' # add this to the top of your Pantfile
32
+ opt_out_usage
33
+ '
32
34
  ]
33
35
  end
34
36
 
37
+ def self.step_text
38
+ 'Disabled Usage Data Tracking'
39
+ end
40
+
35
41
  def self.category
36
42
  :misc
37
43
  end
@@ -1,4 +1,4 @@
1
- require "pantograph/actions/min_pantograph_version"
1
+ require 'pantograph/actions/min_pantograph_version'
2
2
 
3
3
  module Pantograph
4
4
  module Actions
@@ -8,7 +8,7 @@ module Pantograph
8
8
  #####################################################
9
9
 
10
10
  def self.description
11
- "Alias for the `min_pantograph_version` action"
11
+ 'Alias for the `min_pantograph_version` action'
12
12
  end
13
13
  end
14
14
  end
@@ -7,7 +7,7 @@ module Pantograph
7
7
  #####################################################
8
8
 
9
9
  def self.description
10
- "Alias for the `puts` action"
10
+ 'Alias for the `puts` action'
11
11
  end
12
12
  end
13
13
  end
@@ -3,13 +3,12 @@ module Pantograph
3
3
  class PromptAction < Action
4
4
  def self.run(params)
5
5
  if params[:boolean]
6
- return params[:ci_input] unless UI.interactive?
7
- return UI.confirm(params[:text])
6
+ return Helper.ci? ? params[:ci_input] : UI.confirm(params[:text])
8
7
  end
9
8
 
10
9
  UI.message(params[:text])
11
10
 
12
- return params[:ci_input] unless UI.interactive?
11
+ return params[:ci_input] if Helper.ci?
13
12
 
14
13
  if params[:multi_line_end_keyword]
15
14
  # Multi line
@@ -58,24 +57,34 @@ module Pantograph
58
57
 
59
58
  def self.available_options
60
59
  [
61
- PantographCore::ConfigItem.new(key: :text,
62
- description: "The text that will be displayed to the user",
63
- default_value: "Please enter some text: "),
64
- PantographCore::ConfigItem.new(key: :ci_input,
65
- description: "The default text that will be used when being executed on a CI service",
66
- default_value: ''),
67
- PantographCore::ConfigItem.new(key: :boolean,
68
- description: "Is that a boolean question (yes/no)? This will add (y/n) at the end",
69
- default_value: false,
70
- is_string: false),
71
- PantographCore::ConfigItem.new(key: :secure_text,
72
- description: "Is that a secure text (yes/no)?",
73
- default_value: false,
74
- is_string: false),
75
- PantographCore::ConfigItem.new(key: :multi_line_end_keyword,
76
- description: "Enable multi-line inputs by providing an end text (e.g. 'END') which will stop the user input",
77
- optional: true,
78
- type: String)
60
+ PantographCore::ConfigItem.new(
61
+ key: :text,
62
+ description: "The text that will be displayed to the user",
63
+ default_value: "Please enter some text: "
64
+ ),
65
+ PantographCore::ConfigItem.new(
66
+ key: :ci_input,
67
+ description: "The default text that will be used when being executed on a CI service",
68
+ default_value: ''
69
+ ),
70
+ PantographCore::ConfigItem.new(
71
+ key: :boolean,
72
+ description: "Is that a boolean question (yes/no)? This will add (y/n) at the end",
73
+ default_value: false,
74
+ is_string: false
75
+ ),
76
+ PantographCore::ConfigItem.new(
77
+ key: :secure_text,
78
+ description: "Is that a secure text (yes/no)?",
79
+ default_value: false,
80
+ is_string: false
81
+ ),
82
+ PantographCore::ConfigItem.new(
83
+ key: :multi_line_end_keyword,
84
+ description: "Enable multi-line inputs by providing an end text (e.g. 'END') which will stop the user input",
85
+ optional: true,
86
+ type: String
87
+ )
79
88
  ]
80
89
  end
81
90
 
@@ -84,7 +93,7 @@ module Pantograph
84
93
  end
85
94
 
86
95
  def self.authors
87
- ["KrauseFx"]
96
+ ['KrauseFx', 'johnknapprs']
88
97
  end
89
98
 
90
99
  def self.is_supported?(platform)
@@ -0,0 +1,128 @@
1
+ module Pantograph
2
+ module Actions
3
+ class PromptSecureAction < Action
4
+ def self.run(params)
5
+ if params[:boolean]
6
+ return Helper.ci? ? params[:ci_input] : UI.confirm(params[:text])
7
+ end
8
+
9
+ UI.message(params[:text])
10
+
11
+ return params[:ci_input] if Helper.ci?
12
+
13
+ if params[:multi_line_end_keyword]
14
+ # Multi line
15
+ end_tag = params[:multi_line_end_keyword]
16
+ UI.important("Submit inputs using \"#{params[:multi_line_end_keyword]}\"")
17
+ user_input = ""
18
+ loop do
19
+ line = STDIN.gets # returns `nil` if called at end of file
20
+ break unless line
21
+ end_tag_index = line.index(end_tag)
22
+ if end_tag_index.nil?
23
+ user_input << line
24
+ else
25
+ user_input << line.slice(0, end_tag_index)
26
+ user_input = user_input.strip
27
+ break
28
+ end
29
+ end
30
+ else
31
+ # Standard one line input
32
+ if params[:secure_text]
33
+ user_input = STDIN.noecho(&:gets).chomp while (user_input || "").length == 0
34
+ else
35
+ user_input = STDIN.gets.chomp.strip while (user_input || "").length == 0
36
+ end
37
+ end
38
+
39
+ return user_input
40
+ end
41
+
42
+ #####################################################
43
+ # @!group Documentation
44
+ #####################################################
45
+
46
+ def self.description
47
+ "Ask the user for a value or for confirmation"
48
+ end
49
+
50
+ def self.details
51
+ [
52
+ "You can use `prompt` to ask the user for a value or to just let the user confirm the next step.",
53
+ "When this is executed on a CI service, the passed `ci_input` value will be returned.",
54
+ "This action also supports multi-line inputs using the `multi_line_end_keyword` option."
55
+ ].join("\n")
56
+ end
57
+
58
+ def self.available_options
59
+ [
60
+ PantographCore::ConfigItem.new(
61
+ key: :text,
62
+ description: 'The text that will be displayed to the user',
63
+ default_value: 'Please enter some text: '
64
+ ),
65
+ PantographCore::ConfigItem.new(
66
+ key: :ci_input,
67
+ description: 'The default text that will be used when being executed on a CI service',
68
+ default_value: ''
69
+ ),
70
+ PantographCore::ConfigItem.new(
71
+ key: :boolean,
72
+ description: 'Is that a boolean question (yes/no)? This will add (y/n) at the end',
73
+ default_value: false,
74
+ is_string: false
75
+ ),
76
+ PantographCore::ConfigItem.new(
77
+ key: :secure_text,
78
+ description: 'Is that a secure text (yes/no)?',
79
+ default_value: false,
80
+ is_string: false
81
+ ),
82
+ PantographCore::ConfigItem.new(
83
+ key: :multi_line_end_keyword,
84
+ description: "Enable multi-line inputs by providing an end text (e.g. 'END') which will stop the user input",
85
+ optional: true,
86
+ type: String
87
+ )
88
+ ]
89
+ end
90
+
91
+ def self.output
92
+ []
93
+ end
94
+
95
+ def self.authors
96
+ ['KrauseFx', 'johnknapprs']
97
+ end
98
+
99
+ def self.is_supported?(platform)
100
+ true
101
+ end
102
+
103
+ def self.example_code
104
+ [
105
+ 'changelog = prompt(text: "Changelog: ")',
106
+ 'changelog = prompt(
107
+ text: "Changelog: ",
108
+ multi_line_end_keyword: "END"
109
+ )
110
+
111
+ crashlytics(notes: changelog)'
112
+ ]
113
+ end
114
+
115
+ def self.sample_return_value
116
+ "User Content\nWithNewline"
117
+ end
118
+
119
+ def self.return_type
120
+ :string
121
+ end
122
+
123
+ def self.category
124
+ :misc
125
+ end
126
+ end
127
+ end
128
+ end
@@ -5,7 +5,7 @@ module Pantograph
5
5
  # Does a hard reset and clean on the repo
6
6
  class ResetGitRepoAction < Action
7
7
  def self.run(params)
8
- if params[:force] || Actions.lane_context[SharedValues::GIT_REPO_WAS_CLEAN_ON_START]
8
+ if params[:force] || Actions.lane_context[SharedValues::ENSURE_GIT_STATUS_CLEAN]
9
9
  paths = params[:files]
10
10
 
11
11
  return paths if Helper.test?