Created
June 5, 2017 17:05
-
-
Save adrianharabula/d1eb8eaf7a707aa5c13bdcb5ff47efc6 to your computer and use it in GitHub Desktop.
Export github issues with ruby octokit
This file contains 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 'json' | |
# !!! DO NOT EVER USE HARD-CODED VALUES IN A REAL APP !!! | |
# Instead, set and test environment variables, like below | |
client = Octokit::Client.new :access_token => ENV['MY_PERSONAL_TOKEN'] | |
client.auto_paginate = true | |
issues = client.issues 'adrianharabula/condr', { :state => 'all' } | |
File.write('comments.json', issues.map(&:to_h).to_json) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment