class Fastlane::Actions::RemoveItemFromKeychainAction

Public Class Methods

authors() click to toggle source
# File lib/fastlane/plugin/secret_keeper/actions/remove_item_from_keychain_action.rb, line 22
def self.authors
  ["Daniel Jankowski"]
end
available_options() click to toggle source
# File lib/fastlane/plugin/secret_keeper/actions/remove_item_from_keychain_action.rb, line 26
def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :item_name,
                            env_name: "SECRET_KEEPER_ITEM_NAME",
                         description: "Item name to be removed from the keychain",
                            optional: false,
                                type: String)
  ]
end
description() click to toggle source
# File lib/fastlane/plugin/secret_keeper/actions/remove_item_from_keychain_action.rb, line 18
def self.description
  "Removes the credentials from the keychain on behalf of the user"
end
is_supported?(platform) click to toggle source
# File lib/fastlane/plugin/secret_keeper/actions/remove_item_from_keychain_action.rb, line 36
def self.is_supported?(platform)
  true
end
run(params) click to toggle source
# File lib/fastlane/plugin/secret_keeper/actions/remove_item_from_keychain_action.rb, line 6
def self.run(params)
  item_name = params[:item_name]

  success = Security::InternetPassword.delete(server: item_name)
  if success 
    UI.success("Sucessfully removed an item from the keychain 🎉")
  else
    UI.error("Could not remove an item from the keychain ❌")
    UI.user_error!("Could not remove an item from the keychain. This can happen if an item you are trying to remove could not be found in the keychain.")
  end
end