Skip to content

Instantly share code, notes, and snippets.

@sonsongithub
Created November 14, 2015 08:59
Show Gist options
  • Select an option

  • Save sonsongithub/1e118ec17ee2a702dada to your computer and use it in GitHub Desktop.

Select an option

Save sonsongithub/1e118ec17ee2a702dada to your computer and use it in GitHub Desktop.
octokit issue closer
require 'octokit'
client = Octokit::Client.new(:access_token => "")
user = client.user
puts user.login
page = 1
issues = []
for i in 1..20
puts page
array = client.list_issues("sonsongithub/reddift", {:page=>page})
issues = issues + array
break if array.length == 0
page = page + 1
end
issues.each{|issue|
if (issue.milestone.title == "Future")
begin
puts issue.title
puts issue.number
client.close_issue("sonsongithub/reddift", issue.number)
rescue => e
puts e
else
end
end
sleep(1)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment