Sha256: 49a134ed024325549942ac9395e1da06e5a1c8216ad17a0a3a6b180833e49273

Contents?: true

Size: 1.25 KB

Versions: 37

Compression:

Stored size: 1.25 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: $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

37 entries across 37 versions & 1 rubygems

Version Path
fastlane-2.14.2 fastlane/lib/fastlane/actions/git_tag_exists.rb
fastlane-2.14.1 fastlane/lib/fastlane/actions/git_tag_exists.rb
fastlane-2.14.0 fastlane/lib/fastlane/actions/git_tag_exists.rb
fastlane-2.13.0 fastlane/lib/fastlane/actions/git_tag_exists.rb
fastlane-2.12.0 fastlane/lib/fastlane/actions/git_tag_exists.rb
fastlane-2.11.0 fastlane/lib/fastlane/actions/git_tag_exists.rb
fastlane-2.10.0 fastlane/lib/fastlane/actions/git_tag_exists.rb
fastlane-2.9.0 fastlane/lib/fastlane/actions/git_tag_exists.rb
fastlane-2.8.0 fastlane/lib/fastlane/actions/git_tag_exists.rb
fastlane-2.7.0 fastlane/lib/fastlane/actions/git_tag_exists.rb
fastlane-2.6.0 fastlane/lib/fastlane/actions/git_tag_exists.rb
fastlane-2.5.0 fastlane/lib/fastlane/actions/git_tag_exists.rb
fastlane-2.4.0 fastlane/lib/fastlane/actions/git_tag_exists.rb
fastlane-2.3.1 fastlane/lib/fastlane/actions/git_tag_exists.rb
fastlane-2.3.0 fastlane/lib/fastlane/actions/git_tag_exists.rb
fastlane-2.2.0 fastlane/lib/fastlane/actions/git_tag_exists.rb
fastlane-2.1.3 fastlane/lib/fastlane/actions/git_tag_exists.rb
fastlane-2.1.2 fastlane/lib/fastlane/actions/git_tag_exists.rb
fastlane-2.1.1 fastlane/lib/fastlane/actions/git_tag_exists.rb
fastlane-2.1.0 fastlane/lib/fastlane/actions/git_tag_exists.rb