Skip to content

Instantly share code, notes, and snippets.

@code-later
Created September 25, 2014 11:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save code-later/8e4814cc0b5d1c3cadc4 to your computer and use it in GitHub Desktop.
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
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