Integrating Git Hub With Trello With Heroku

I was pretty miffed at the lack of documentation and how-to's on getting some sort of useful connection between GitHub and Trello. All I needed was something simple:

  • Commits would add the messages to cards.
  • Some commands could move cards through a Kanban flow.

I wanted to do things like this:

git commit -m 'added a bunch of code to start 24'

And have card 24 move from my "Ready for Development" list to my "Doing" list, adding the commit message to the card as a comment.

This post will serve as a general set up guide for the whole thang.

Set up Heroku

Go get a free account here. Follow the instructions to install the terminal tools. Login with your account.

Gather config values

  • api_key - Go to
    Location of developer API Key
  • oauth_token - Go to,write&expiration=never&key=[your-key-here]_ replacing __[your-key-here]__ with the api_key from above. Authorize the request:
    Trello authorization screen

And record the token.

Confirmation Screen
- board_id - You can get the board id from the URL, for example the board id is 4d5ea62fd76aa1136000000ca. - …listtargetid - These can be found by opening a card in the list, exporting it as json, and grabbing the "idList" value.

Deploy to Heroku

Follow these steps replacing the flagged values, with the ones you gathered above:

  • Clone this repo
  • cd github-trello - go into that directory
  • heroku create - create the Heroku app
  • heroku config:add api_key=<API_KEY> oauth_token=<OATH_TOKEN> board_id=<BOARD_ID> start_list_target_id=<ID> finish_list_target_id=<ID> - add all your details
  • git push heroku master - deploy!
    Screenshot of deploying to heroku

Now the server should be running on Heroku.

Set up GitHub

Simply add your Heroku app URL + "/posthook" as a WebHook URL under "Admin" for your repository. Example:

Github post hook screen

That's it!

Now when you commit to your git repo with the right flags:

  • start and per will move the card to a list specified in configuration by the start_list_target_id parameter.
  • finish and fix will move the card to a list specified in configuration by the finish_list_target_id parameter.

Your Trello card will be updated with a comment or moved between lists, something like this:

Example trello message from a github update

Have fun!

If you enjoyed reading this or learned something, please consider sharing via , , or . Thanks!