Created
September 25, 2014 11:50
-
-
Save code-later/8e4814cc0b5d1c3cadc4 to your computer and use it in GitHub Desktop.
Creates Trello cards in the Backlog based on open GitHub issues with the link to the issue as description
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 'trello' | |
@repo, @prefix = ARGV | |
Trello.configure do |config| | |
config.developer_public_key = TRELLO_DEVELOPER_PUBLIC_KEY | |
config.member_token = TRELLO_MEMBER_TOKEN | |
end | |
require 'octokit' | |
GitHub = Octokit::Client.new(:access_token => GITHUB_ACCESS_TOKEN) | |
list_id = Trello::Board.find(TRELLO_BOARD_ID).lists.find { |list| list.name == 'Backlog' }.id | |
p list_id | |
GitHub.list_issues(@repo).each do |issue| | |
puts issue['title'] | |
Trello::Card.create(name: "#{@prefix} #{issue['title']}", | |
list_id: list_id, | |
desc: issue['html_url']) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment