Created
November 14, 2015 08:59
-
-
Save sonsongithub/1e118ec17ee2a702dada to your computer and use it in GitHub Desktop.
octokit issue closer
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' | |
| 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