Sha256: 90a35ac9ee6bd6addb01c8f7d586688eb31b4bbe39c14212eb70b74b64263d80

Contents?: true

Size: 1.27 KB

Versions: 529

Compression:

Stored size: 1.27 KB

Contents

module Fastlane
  module Actions
    class GitTagExistsAction < Action
      def self.run(params)
        result = Actions.sh("git rev-parse -q --verify refs/tags/#{params[:tag].shellescape} || true", log: FastlaneCore::Globals.verbose?).chomp
        !result.empty?
      end

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

      def self.description
        "Checks if the git tag with the given name exists in the current repo"
      end

      def self.details
        nil
      end

      def self.available_options
        [
          FastlaneCore::ConfigItem.new(key: :tag,
                                       description: "The tag name that should be checked")
        ]
      end

      def self.return_value
        "Boolean value whether the tag exists or not"
      end

      def self.output
        [
        ]
      end

      def self.authors
        ["antondomashnev"]
      end

      def self.is_supported?(platform)
        true
      end

      def self.example_code
        [
          'if git_tag_exists(tag: "1.1.0")
            UI.message("Found it 🚀")
          end'
        ]
      end

      def self.category
        :source_control
      end
    end
  end
end

Version data entries

529 entries across 529 versions & 1 rubygems

Version Path
fastlane-2.88.0.beta.20180325050025 fastlane/lib/fastlane/actions/git_tag_exists.rb
fastlane-2.88.0.beta.20180324050059 fastlane/lib/fastlane/actions/git_tag_exists.rb
fastlane-2.87.0 fastlane/lib/fastlane/actions/git_tag_exists.rb
fastlane-2.87.0.beta.20180323050014 fastlane/lib/fastlane/actions/git_tag_exists.rb
fastlane-2.87.0.beta.20180322050115 fastlane/lib/fastlane/actions/git_tag_exists.rb
fastlane-2.86.2 fastlane/lib/fastlane/actions/git_tag_exists.rb
fastlane-2.87.0.beta.20180321050017 fastlane/lib/fastlane/actions/git_tag_exists.rb
fastlane-2.86.1 fastlane/lib/fastlane/actions/git_tag_exists.rb
fastlane-2.87.0.beta.20180320050108 fastlane/lib/fastlane/actions/git_tag_exists.rb
fastlane-2.86.0 fastlane/lib/fastlane/actions/git_tag_exists.rb
fastlane-2.86.0.beta.20180319050058 fastlane/lib/fastlane/actions/git_tag_exists.rb
fastlane-2.86.0.beta.20180318050106 fastlane/lib/fastlane/actions/git_tag_exists.rb
fastlane-2.86.0.beta.20180317050040 fastlane/lib/fastlane/actions/git_tag_exists.rb
fastlane-2.86.0.beta.20180316050051 fastlane/lib/fastlane/actions/git_tag_exists.rb
fastlane-2.86.0.beta.20180315050105 fastlane/lib/fastlane/actions/git_tag_exists.rb
fastlane-2.86.0.beta.20180314050053 fastlane/lib/fastlane/actions/git_tag_exists.rb
fastlane-2.86.0.beta.20180313050023 fastlane/lib/fastlane/actions/git_tag_exists.rb
fastlane-2.86.0.beta.20180312050111 fastlane/lib/fastlane/actions/git_tag_exists.rb
fastlane-2.86.0.beta.20180311050103 fastlane/lib/fastlane/actions/git_tag_exists.rb
fastlane-2.86.0.beta.20180310050010 fastlane/lib/fastlane/actions/git_tag_exists.rb