Sha256: fb4e210ea8e055bd97883b7c74b3a691957ba60e0c0a9ade8574713b9777ad46

Contents?: true

Size: 962 Bytes

Versions: 2

Compression:

Stored size: 962 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
  opt :org, "The organization to reenable workflows in", :type => :string, :required => true
  opt :extra_repos, "Extra repos to reenable workflows in", :type => :strings, :default => []

  MultiRepo::CLI.common_options(self, :only => :dry_run)
ende

github = MultiRepo::Service::Github.new(**opts.slice(:dry_run))

repos = (github.org_repo_names(opts[:org]) + opts[:extra_repos]).sort
repos.each do |repo_name|
  puts MultiRepo::CLI.header(repo_name)

  disabled_workflows = github.disabled_workflows
  if disabled_workflows.any?
    disabled_workflows.each do |w|
      puts "** Enabling #{w.html_url} (#{w.id})"
      github.enable_workflow(github, repo_name, w.html_url, w.id)
    end
  else
    puts "** No disabled workflows found"
  end

  puts
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
multi_repo-0.1.1 scripts/reenable_repo_workflows
multi_repo-0.1.0 scripts/reenable_repo_workflows