Skip to content

Instantly share code, notes, and snippets.

@schweigert
Created February 17, 2021 13:11
Show Gist options
  • Save schweigert/2f6985f83c1e7953f662c91129a7f5d1 to your computer and use it in GitHub Desktop.
Save schweigert/2f6985f83c1e7953f662c91129a7f5d1 to your computer and use it in GitHub Desktop.
Script to update all repositories in an organization
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