Class: Fastlane::Actions::AppStoreConnectApiKeyRemoveFromRemoteAction
- Inherits:
-
Action
- Object
- Action
- Fastlane::Actions::AppStoreConnectApiKeyRemoveFromRemoteAction
- Defined in:
- lib/fastlane/plugin/yalantis_ci/actions/app_store_connect_api_key_remove_from_remote.rb
Documentation collapse
- .authors ⇒ Object
- .available_options ⇒ Object
- .description ⇒ Object
- .is_supported?(platform) ⇒ Boolean
Class Method Summary collapse
Class Method Details
.authors ⇒ Object
60 61 62 |
# File 'lib/fastlane/plugin/yalantis_ci/actions/app_store_connect_api_key_remove_from_remote.rb', line 60 def self. ["Dima Vorona", "Yalantis"] end |
.available_options ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/fastlane/plugin/yalantis_ci/actions/app_store_connect_api_key_remove_from_remote.rb', line 37 def self. [ FastlaneCore::ConfigItem.new( key: :git_repo_url, env_name: "APP_STORE_CONNECT_API_KEY_GIT_REPO_URL", description: "Git repo URL where AppStore Connect's Api Key should be stored in", type: String ), FastlaneCore::ConfigItem.new( key: :git_repo_branch, env_name: "APP_STORE_CONNECT_API_KEY_GIT_REPO_BRANCH", description: "Git repo branch where AppStore Connect's Api Key should be stored in", type: String, default_value: 'master' ), FastlaneCore::ConfigItem.new( key: :key_id, env_name: "APP_STORE_CONNECT_API_KEY_KEY_ID", description: "The key ID", ) ] end |
.description ⇒ Object
33 34 35 |
# File 'lib/fastlane/plugin/yalantis_ci/actions/app_store_connect_api_key_remove_from_remote.rb', line 33 def self.description "Remove AppStore Connect API Key from the remote git repo" end |
.is_supported?(platform) ⇒ Boolean
64 65 66 |
# File 'lib/fastlane/plugin/yalantis_ci/actions/app_store_connect_api_key_remove_from_remote.rb', line 64 def self.is_supported?(platform) [:ios, :mac].include?(platform) end |
.run(options) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/fastlane/plugin/yalantis_ci/actions/app_store_connect_api_key_remove_from_remote.rb', line 8 def self.run() git_repo_url = [:git_repo_url] git_repo_branch = [:git_repo_branch] key_id = [:key_id] Helper::GitHelper.clone_repo_in_tmp(repo_url: git_repo_url, branch: git_repo_branch) do |dir| target_filename = "#{key_id}.p8" target_filepath = File.join(dir, target_filename) if File.exist?(target_filepath) UI.("Removing '#{key_id}.p8' at #{git_repo_url}") FileUtils.rm(target_filepath) Actions.sh("git rm #{target_filename} && git commit -m '[AppStore Connect API Key] Remove '#{key_id}.p8' key'") Actions.sh("git push -f #{git_repo_url} #{git_repo_branch}") else UI.("Skipping remove of '#{key_id}.p8' as no file has been found at #{git_repo_url}") end end end |