How to Automate Your Trello Board with GitHub

How to Automate Your Trello Board with GitHub

·

4 min read

SOURCE CODE: CLICK HERE...

If you use Trello to manage your projects and tasks, you know how useful it is to have a visual overview of your progress. But did you know that you can also automate your Trello board by only pushing commits to GitHub?

In this blog post, I’ll show you how to use this repository to move your cards on Trello automatically based on your commit messages. For example, if you have a card item on Trello with name “change the title” and push commit with message “doing: change the title”, it will automatically move that specific card to the Doing list on your Trello board. If the commit message is “done: change the title”, then this card will be automatically moved to Done list.

This way, you can save time and avoid manual errors by syncing your GitHub and Trello activities. Sounds cool, right? Let’s see how it works.

What You’ll Need

To use this repository, you’ll need the following:

  • A Trello account and a board with To Do, Doing, and Done lists. You can create one for free here.

  • A GitHub account and a repository that you want to link with your Trello board. You can create one for free here.

  • Your Trello API key, token and board id. You can get them from here.

  • Your GitHub username and the repository name that this action will be executed on.

How to Set It Up

Once you have everything ready, follow these steps to set up the automation:

  1. Clone or fork this repository to your GitHub account.

  2. Go to the repository’s settings and click on Secrets.

  3. Add the following secrets with their corresponding values: TRELLO_KEY, TRELLO_TOKEN, TRELLO_BOARD_ID, GITHUB_USERNAME, GITHUB_REPO_NAME. Make sure they match exactly with the variable names in trello.py and github.py files.

  4. Copy the file .github\workflows\main.yml under .github\workflows folder in your repository. This file contains the code that triggers the action every time you push on GitHub.

  5. That’s it! You’re ready to test it out.

How to Use It

To use the automation, you just need to follow a simple convention when naming your cards on Trello and your commit messages on GitHub.

  • The card name on Trello should match exactly with the commit message on GitHub, except for the prefix “doing:” or “done:” which indicates the list you want to move the card to.

  • The commit message on GitHub should start with either “doing:” or “done:” followed by a space and then the card name on Trello.

For example, if you have a card on Trello with name “write a blog post”, you can push a commit with message “doing: write a blog post” to move it to Doing list, or “done: write a blog post” to move it to Done list.

You can also use multiple cards and commits in one push, as long as they follow the same convention.

Limitations and Customizations

This repository is meant to be a simple and easy way to automate your Trello board with GitHub, but it has some limitations and assumptions that you should be aware of:

  • It assumes that you have already created the cards in To Do list on your Trello board and that your board only has To Do, Doing and Done lists. If you want to use different lists or create cards dynamically, you’ll need to modify the code accordingly.

  • It only works with one board at a time. If you want to use multiple boards or repositories, you’ll need to create separate secrets and workflows for each one.

  • It only moves cards between lists based on commit messages. It doesn’t update any other information such as labels, comments, or attachments. If you want to add more features or functionality, you’ll need to extend the code accordingly.

Of course, you’re free to clone and customize this repository according to your needs and preferences. You can also contribute to it by submitting pull requests or issues on GitHub.

Conclusion

In this blog post, I showed you how to automate your Trello board by only pushing commits to GitHub using this repository. This can help you streamline your workflow and keep track of your progress more easily.

I hope you found this tutorial useful and interesting. If you have any questions or feedback, feel free to leave a comment below!