Sha256: b0c68494c6183e7f83e88d7c2e2e2053d26fd61e40d7440689feb699e58d0783

Contents?: true

Size: 648 Bytes

Versions: 11

Compression:

Stored size: 648 Bytes

Contents

module MultiRepo::Helpers
  class UpdateBranchProtection
    attr_reader :repo_name, :branch, :dry_run, :github

    def initialize(repo_name, branch:, dry_run: false, **)
      @repo_name = repo_name
      @branch    = branch
      @github    = MultiRepo::Service::Github.new(dry_run: dry_run)
    end

    def run
      puts "Protecting #{branch} branch"

      settings = {
        :enforce_admins                => nil,
        :required_status_checks        => nil,
        :required_pull_request_reviews => nil,
        :restrictions                  => nil
      }

      github.protect_branch(repo_name, branch, settings)
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
multi_repo-0.5.0 lib/multi_repo/helpers/update_branch_protection.rb
multi_repo-0.4.0 lib/multi_repo/helpers/update_branch_protection.rb
multi_repo-0.3.1 lib/multi_repo/helpers/update_branch_protection.rb
multi_repo-0.3.0 lib/multi_repo/helpers/update_branch_protection.rb
multi_repo-0.2.3 lib/multi_repo/helpers/update_branch_protection.rb
multi_repo-0.2.2 lib/multi_repo/helpers/update_branch_protection.rb
multi_repo-0.2.1 lib/multi_repo/helpers/update_branch_protection.rb
multi_repo-0.2.0 lib/multi_repo/helpers/update_branch_protection.rb
multi_repo-0.1.2 lib/multi_repo/helpers/update_branch_protection.rb
multi_repo-0.1.1 lib/multi_repo/helpers/update_branch_protection.rb
multi_repo-0.1.0 lib/multi_repo/helpers/update_branch_protection.rb