Sha256: 03c391afe718a2ec44023dceddc09ea3e84e2894e7ac37863dfc79e644278f7e

Contents?: true

Size: 1.5 KB

Versions: 4

Compression:

Stored size: 1.5 KB

Contents

require 'shellwords'

module Fastlane
  module Actions
    class ImportCertificateAction < Action
      def self.run(params)
        command = "security import #{params[:certificate_path].shellescape} -k ~/Library/Keychains/#{params[:keychain_name].shellescape}"
        command << " -P #{params[:certificate_password].shellescape}" if params[:certificate_password]
        command << " -T /usr/bin/codesign"

        Fastlane::Actions.sh command, log: false
      end

      def self.description
        "Import certificate from inputfile into a keychain"
      end

      def self.available_options
        [
          FastlaneCore::ConfigItem.new(key: :keychain_name,
                                       env_name: "KEYCHAIN_NAME",
                                       description: "Keychain name into which item",
                                       optional: false),
          FastlaneCore::ConfigItem.new(key: :certificate_path,
                                       env_name: "",
                                       description: "Path to certificate",
                                       optional: false),
          FastlaneCore::ConfigItem.new(key: :certificate_password,
                                       env_name: "",
                                       description: "Certificate password",
                                       optional: true),
        ]
      end

      def self.authors
        ["gin0606"]
      end

      def self.is_supported?(platform)
        true
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fastlane-1.7.3 lib/fastlane/actions/import_certificate.rb
fastlane-1.7.2 lib/fastlane/actions/import_certificate.rb
fastlane-1.7.1 lib/fastlane/actions/import_certificate.rb
fastlane-1.7.0 lib/fastlane/actions/import_certificate.rb