Created
February 17, 2021 13:11
-
-
Save schweigert/2f6985f83c1e7953f662c91129a7f5d1 to your computer and use it in GitHub Desktop.
Script to update all repositories in an organization
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'octokit' | |
require 'pry' | |
username = '' | |
token = '' | |
org = '' | |
client = Octokit::Client.new(login: username, password: token) | |
client.organization_repositories(org).map do |repo| | |
client.repository(repo.full_name) | |
end.each do |repo| | |
# binding.pry | |
# Remove this comment above to debug what attributes you can update | |
client.update_repository(repo.full_name, delete_branch_on_merge: true) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment