Class: Fastlane::Actions::RemoveBranchProtectionAction
- Inherits:
-
Action
- Object
- Action
- Fastlane::Actions::RemoveBranchProtectionAction
- Defined in:
- lib/fastlane/plugin/wpmreleasetoolkit/actions/common/remove_branch_protection_action.rb
Class Method Summary collapse
- .authors ⇒ Object
- .available_options ⇒ Object
- .description ⇒ Object
- .details ⇒ Object
- .is_supported?(platform) ⇒ Boolean
- .return_value ⇒ Object
- .run(params) ⇒ Object
Class Method Details
.authors ⇒ Object
50 51 52 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/common/remove_branch_protection_action.rb', line 50 def self. ['Automattic'] end |
.available_options ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/common/remove_branch_protection_action.rb', line 34 def self. [ FastlaneCore::ConfigItem.new(key: :repository, env_name: 'GHHELPER_REPOSITORY', description: 'The remote path of the GH repository on which we work', optional: false, type: String), FastlaneCore::ConfigItem.new(key: :branch, env_name: 'GHHELPER_BRANCH', description: 'The branch to unprotect', optional: false, type: String), Fastlane::Helper::GithubHelper.github_token_config_item, ] end |
.description ⇒ Object
22 23 24 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/common/remove_branch_protection_action.rb', line 22 def self.description 'Removes the protection settings for the specified branch' end |
.details ⇒ Object
26 27 28 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/common/remove_branch_protection_action.rb', line 26 def self.details description end |
.is_supported?(platform) ⇒ Boolean
54 55 56 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/common/remove_branch_protection_action.rb', line 54 def self.is_supported?(platform) true end |
.return_value ⇒ Object
30 31 32 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/common/remove_branch_protection_action.rb', line 30 def self.return_value # If your method provides a return value, you can describe here what it does end |
.run(params) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/common/remove_branch_protection_action.rb', line 7 def self.run(params) repository = params[:repository] branch_name = params[:branch] github_helper = Fastlane::Helper::GithubHelper.new(github_token: params[:github_token]) github_helper.remove_branch_protection( repository: repository, branch: branch_name ) rescue Octokit::NotFound UI.user_error!("Branch `#{branch_name}` of repository `#{repository}` was not found.") rescue Octokit::BranchNotProtected UI.("Note: Branch `#{branch_name}` was not protected in the first place.") end |