class Fastlane::Actions::EnsureTagNotExistsAction

Public Class Methods

authors() click to toggle source
# File lib/fastlane/plugin/menigit/actions/ensure_tag_not_exists.rb, line 62
def self.authors
  ["Artur Stępniewski"]
end
available_options() click to toggle source
# File lib/fastlane/plugin/menigit/actions/ensure_tag_not_exists.rb, line 26
def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :tag,
                   env_name: "FL_ENSURE_TAG_NOT_EXISTS_TAG",
                   description: "The tag name that should be checked",
                   optional: false,
                   type: String),
    FastlaneCore::ConfigItem.new(key: :remote,
                   env_name: "FL_ENSURE_TAG_NOT_EXISTS_TAG_REMOTE",
                   description: "Whether to check remote. Defaults to true",
                   optional: true,
                   default_value: false,
                   type: Boolean),
    FastlaneCore::ConfigItem.new(key: :remote_name,
                    env_name: "FL_ENSURE_TAG_NOT_EXISTS_TAG_REMOTE_NAME",
                    description: "Whether to check remote. Defaults to true",
                    optional: true,
                    default_value: "origin",
                    type: String)
  ]
end
category() click to toggle source
# File lib/fastlane/plugin/menigit/actions/ensure_tag_not_exists.rb, line 54
def self.category
  :source_control
end
description() click to toggle source
# File lib/fastlane/plugin/menigit/actions/ensure_tag_not_exists.rb, line 22
def self.description
  "Checks if the git tag with the given name not exists in the current repo"
end
example_code() click to toggle source
# File lib/fastlane/plugin/menigit/actions/ensure_tag_not_exists.rb, line 48
def self.example_code
  [
    'ensure_tag_not_exist(tag: "3.2.2", remote: true)'
  ]
end
is_supported?(platform) click to toggle source
# File lib/fastlane/plugin/menigit/actions/ensure_tag_not_exists.rb, line 58
def self.is_supported?(platform)
  true
end
run(params) click to toggle source
# File lib/fastlane/plugin/menigit/actions/ensure_tag_not_exists.rb, line 6
def self.run(params)
  tag = params[:tag]
  remote = params[:remote]
  remote_name = params[:remote_name]
  if other_action.git_tag_exists(tag: tag, remote: remote, remote_name: remote_name)
    error_message = "Tag #{tag} already exists"
    if remote
      error_message += " in #{remote_name}"
    end
    error_message += "!"
    UI.user_error!(error_message)
  else
    UI.success("Success! Tag #{tag} not exists!")
  end
end