Sha256: 77eadea4c12368b4d51d74c03325c524779d945e4001ee3cc9385976b5e7571d

Contents?: true

Size: 1.21 KB

Versions: 13

Compression:

Stored size: 1.21 KB

Contents

module Fastlane
  module Actions
    module SharedValues
    end

    class GitBranchAction < Action
      def self.run(params)
        return ENV['GIT_BRANCH'] if FastlaneCore::Env.truthy?('GIT_BRANCH')
        return ENV['BRANCH_NAME'] if FastlaneCore::Env.truthy?('BRANCH_NAME')
        return ENV["TRAVIS_BRANCH"] if FastlaneCore::Env.truthy?("TRAVIS_BRANCH")
        return ENV["BITRISE_GIT_BRANCH"] if FastlaneCore::Env.truthy?("BITRISE_GIT_BRANCH")
        `git symbolic-ref HEAD --short 2>/dev/null`.strip
      end

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

      def self.description
        "Returns the name of the current git branch"
      end

      def self.details
        "If no branch could be found, this action will return nil"
      end

      def self.available_options
        []
      end

      def self.output
        []
      end

      def self.authors
        ["KrauseFx"]
      end

      def self.is_supported?(platform)
        true
      end

      def self.example_code
        [
          'git_branch'
        ]
      end

      def self.category
        :source_control
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
fastlane-2.18.0.beta.20170217010035 fastlane/lib/fastlane/actions/git_branch.rb
fastlane-2.18.0.beta.20170216184940 fastlane/lib/fastlane/actions/git_branch.rb
fastlane-2.17.1 fastlane/lib/fastlane/actions/git_branch.rb
fastlane-2.17.0 fastlane/lib/fastlane/actions/git_branch.rb
fastlane-2.16.0 fastlane/lib/fastlane/actions/git_branch.rb
fastlane-2.15.1 fastlane/lib/fastlane/actions/git_branch.rb
fastlane-2.16.0.beta.20170214010051 fastlane/lib/fastlane/actions/git_branch.rb
fastlane-2.15.0 fastlane/lib/fastlane/actions/git_branch.rb
fastlane-2.15.0.beta.20170213032052 fastlane/lib/fastlane/actions/git_branch.rb
fastlane-2.14.2 fastlane/lib/fastlane/actions/git_branch.rb
fastlane-2.14.1 fastlane/lib/fastlane/actions/git_branch.rb
fastlane-2.14.0 fastlane/lib/fastlane/actions/git_branch.rb
fastlane-2.13.0 fastlane/lib/fastlane/actions/git_branch.rb