Class: Fastlane::Actions::GitAuthorsAction

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

Class Method Summary collapse

Class Method Details

.authorsObject



17
18
19
# File 'lib/fastlane/plugin/git_authors/actions/git_authors_action.rb', line 17

def self.authors
  ["Viktor Rutberg"]
end

.available_optionsObject



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/fastlane/plugin/git_authors/actions/git_authors_action.rb', line 30

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :prefix,
                            env_name: "GIT_AUTHORS_PREFIX",
                         description: "A prefix for the list of authors",
                            optional: true,
                                type: String),

    FastlaneCore::ConfigItem.new(key: :suffix,
                            env_name: "GIT_AUTHORS_SUFFIX",
                         description: "A suffix for the list of authors",
                            optional: true,
                                type: String)
  ]
end

.descriptionObject



13
14
15
# File 'lib/fastlane/plugin/git_authors/actions/git_authors_action.rb', line 13

def self.description
  "List all authors of a Git repository"
end

.detailsObject



25
26
27
28
# File 'lib/fastlane/plugin/git_authors/actions/git_authors_action.rb', line 25

def self.details
  # Optional:
  "This plugin gives you a list of all authors of a Git repository with an optional prefix and an optional suffix"
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


46
47
48
49
50
51
52
# File 'lib/fastlane/plugin/git_authors/actions/git_authors_action.rb', line 46

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, :mac, :android].include?(platform)
  true
end

.return_valueObject



21
22
23
# File 'lib/fastlane/plugin/git_authors/actions/git_authors_action.rb', line 21

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

.run(params) ⇒ Object



4
5
6
7
8
9
10
11
# File 'lib/fastlane/plugin/git_authors/actions/git_authors_action.rb', line 4

def self.run(params)
  prefix = params[:prefix] == nil ? "Made with ❤️  by" : params[:prefix]
  suffix = params[:suffix] == nil ? "" : params[:suffix]

  output = Actions.sh("git log --format='%aN' | sort | uniq")

  UI.message([prefix, output.split("\n").join(", "), suffix].join(" "))
end