Sha256: ea0d0e56398b44c401a37943676059b5426805f87b4f3bf58af17db4dafc0b66
Contents?: true
Size: 1.3 KB
Versions: 106
Compression:
Stored size: 1.3 KB
Contents
module Fastlane module Actions class NumberOfCommitsAction < Action def self.is_git? Actions.sh 'git rev-parse HEAD' return true rescue return false end def self.run(params) if is_git? command = 'git rev-list HEAD --count' else UI.user_error!("Not in a git repository.") end return Actions.sh(command).strip.to_i end ##################################################### # @!group Documentation ##################################################### def self.description "Return the total number of all commits in current git repo" end def self.return_value "The total number of all commits in current git repo" end def self.details "You can use this action to get the number of commits of this repo. This is useful if you want to set the build number to the number of commits." end def self.authors ["onevcat"] end def self.is_supported?(platform) true end def self.example_code [ 'build_number = number_of_commits increment_build_number(build_number: build_number)' ] end def self.category :source_control end end end end
Version data entries
106 entries across 106 versions & 1 rubygems