Sha256: 694504553510d0fd2c0d5f5e7bf9454aefbaf0411db74c23b4039c0f6a1aaf8d

Contents?: true

Size: 729 Bytes

Versions: 6

Compression:

Stored size: 729 Bytes

Contents

#!/usr/bin/env ruby

require "bundler/inline"
gemfile do
  source "https://rubygems.org"
  gem "multi_repo", require: "multi_repo/cli", path: File.expand_path("..", __dir__)
end

opts = Optimist.options do
  synopsis "Update the branch protection for all GitHub repos."

  opt :branch, "The branch to protect.", :type => :string, :required => true

  MultiRepo::CLI.common_options(self, :repo_set_default => nil)
end
opts[:repo_set] = opts[:branch] unless opts[:repo] || opts[:repo_set]

MultiRepo::CLI.repos_for(**opts).each do |repo|
  next if opts[:branch] != "master" && repo.config.has_real_releases

  puts MultiRepo::CLI.header(repo.name)
  MultiRepo::Helpers::UpdateBranchProtection.new(repo.name, **opts).run
  puts
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
multi_repo-0.5.0 scripts/update_branch_protection
multi_repo-0.4.0 scripts/update_branch_protection
multi_repo-0.3.1 scripts/update_branch_protection
multi_repo-0.3.0 scripts/update_branch_protection
multi_repo-0.2.3 scripts/update_branch_protection
multi_repo-0.2.2 scripts/update_branch_protection