Sha256: 5aa05d6f37e385bc13dcb9e8b15a157e8c591f04ee1450872fe45b8ac6d510f2

Contents?: true

Size: 1.29 KB

Versions: 12

Compression:

Stored size: 1.29 KB

Contents

module Fastlane
  module Actions
    class GitBranchAction < Action
      def self.run(params)
        branch = Actions.git_branch || ""
        return "" if branch == "HEAD" # Backwards compatibility with the original (and documented) implementation
        branch
      end

      #####################################################
      # @!group Documentation
      #####################################################

      def self.description
        "Returns the name of the current git branch, possibly as managed by CI ENV vars"
      end

      def self.details
        "If no branch could be found, this action will return an empty string. If `FL_GIT_BRANCH_DONT_USE_ENV_VARS` is `true`, it'll ignore CI ENV vars. This is a wrapper for the internal action Actions.git_branch"
      end

      def self.available_options
        []
      end

      def self.output
        [
          ['GIT_BRANCH_ENV_VARS', 'The git branch environment variables']
        ]
      end

      def self.authors
        ["KrauseFx"]
      end

      def self.is_supported?(platform)
        true
      end

      def self.example_code
        [
          'git_branch'
        ]
      end

      def self.return_type
        :string
      end

      def self.category
        :source_control
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
fastlane-2.225.0 fastlane/lib/fastlane/actions/git_branch.rb
fastlane-2.224.0 fastlane/lib/fastlane/actions/git_branch.rb
fastlane-2.223.1 fastlane/lib/fastlane/actions/git_branch.rb
fastlane-2.223.0 fastlane/lib/fastlane/actions/git_branch.rb
fastlane-2.222.0 fastlane/lib/fastlane/actions/git_branch.rb
fastlane-2.221.1 fastlane/lib/fastlane/actions/git_branch.rb
fastlane-2.221.0 fastlane/lib/fastlane/actions/git_branch.rb
fastlane-2.220.0 fastlane/lib/fastlane/actions/git_branch.rb
fastlane-2.219.0 fastlane/lib/fastlane/actions/git_branch.rb
fastlane-2.218.0 fastlane/lib/fastlane/actions/git_branch.rb
fastlane-security-patched-2.216.0 fastlane/lib/fastlane/actions/git_branch.rb
fastlane-2.217.0 fastlane/lib/fastlane/actions/git_branch.rb