How to supercharge your GitHub Workflow

David Boyne
Compare the Market
Published in
7 min readJul 24, 2018

I love the idea of open source software. The ability to share code around the world fascinates me, and the innovation it creates is mind-blowing.

Recently at comparethemarket we have been exploring inner source and how it can help our business scale by sharing code across the organisation.

I have recently been spending a lot of time within GitHub, and have learned techniques and built tools to help our team automate and supercharge our GitHub workflow. ⛈

When the team started with inner sourcing I found there was a huge amount of manual processing we had to do (Reviews, Comments, Jira, Context Switching, etc).

I started to look around to see if there was any way we could automate tasks to help us focus on contributors & code rather than the admin.

In this blog post we will be looking into three areas:

  1. What you get for free (Out the box with GitHub)
  2. Custom Apps & Plugins
  3. Building your own apps

I’m still on the journey of Inner source and managing GitHub workflows, so things mentioned in this blog post will not be perfect, but hopefully the learnings I have found may help you.

That’s enough introduction, lets’ dive in and start with what we get for free.

#1. What you get for free

Photo by Rob Lambert on Unsplash

GitHub comes with a ton of features out the box some more obvious than others.

Whilst on this journey of inner source at comparethemarket, I have learned behaviourally if you want contributors you need to have a repo that is:

  • Welcoming
  • Friendly
  • Easy to contribute to
  • Open to suggestions

Here are a couple of ways to help contributors feel welcome and lower the barrier to entry.

1. CODEOWNERS File

A CODEOWNERS file is a great way to define individuals or teams that are responsible for the repository.

The great thing about the ./github/CODEOWNERS.md file is that it automatically requests the code-owners to review a pull request when someone opens a pull request that modifies the code.

With this file one of our team members must review the pull request. This is great for our inner source model, as we want to welcome contributors, but we need to maintain the code and its direction.

You can find out more information on the CODEOWNERS file here:

https://help.github.com/articles/about-codeowners/

2. Templates

You can create templates for issues and pull requests. These are super easy to get set up and can be very useful.

Daily we have multiple issues and pull requests come into our repository. Setting templates allow us to set standards when raising pull requests and issues.

It’s a great way to inform contributors (if they read them…)

You can find more information on templates here:

https://blog.github.com/2016-02-17-issue-and-pull-request-templates/

2.1 Issue Templates — Types

https://blog.github.com/2018-05-02-issue-template-improvements/

This year GitHub enabled the ability to create multiple issue templates. These are awesome and allow you to split out your issues by type.

For example, you may have a template for Bugs 🐛 and a template for a New Feature 💻 (as seen in the photo).

More information about the template types can be found here:

https://blog.github.com/2018-05-02-issue-template-improvements/

3. GitHub Projects

I’m not quite sure what it is, but GitHub notifications don’t seem helpful at times. Your notifications can easily get lost and it’s hard to keep track of them.

https://help.github.com/articles/about-project-boards/

GitHub projects are a great way to manage and visualise issues and pull requests. You can automate each column (new & closed issues and pull requests) and can get a great overview of your repo/project.

Our team have started to use this to manage issues & pull requests within our monorepo. It’s a great way to visually see what’s going on and manage issues and pull requests.

GitHub Projects seems to be missing a few bits of functionality which were key for us. You can extend the functionality of GitHub projects with extensions. Il talk about this later.

If you’re interested in GitHub projects check out the link:

So, we covered a couple of things GitHub gives you out the box, but there are more ways to supercharge your workflow, let’s look into some GitHub Apps, Repos and 3rd Party Tools.

#2. Custom Apps & Plugins

Photo by Sandro Katalina on Unsplash

What I didn’t realise when looking into automation and GitHub is the Marketplace is full of awesome apps that can really help you automate and supercharge ⛈️ your workflow.

I have been exploring the marketplace and here are some tools I found interesting & useful.

  • Zenhub — Great project management tool for GitHub. We trailed this for a while and it has some great features.
  • Slack + GitHub — Great tool to integrate GitHub and Slack. The integration can get noisy at times but worthwhile having if you want to integrate the two.
  • Probot/Stale — Great way to keep track of your stale issues and pull requests. Configure in your repository and let the bot manage old issues/pull requests.
  • Probot/WIP — Great way to prevent pull requests being merged with WIP in the title. I haven’t used this yet but can see the benefits it could add.
  • Probot/Auto-commentShameless Plug. A bot that auto comments on any issue or pull request that is opened or closed. All configured with a config file in your repo. I built this as a way to communicate back to developers just after they create an issue or pull request to let them know the expected response time and a checklist of items they have to fulfil.
  • Project-bot — A bot that enables more features with GitHub Projects. Allows you to automate your GitHub Project with GitHub events. For example, move an issue or pull request on the project to “Requires UX” when labeled as “requires-ux”. If you’re using Github Projects check this one out, and see if it can help.
  • refined-github — An awesome chrome extension that adds more features to GitHub. I have only just started using this recently and its pretty sweet.
  • OctoLinker — Great way to navigate code on GitHub.
  • awesome-browser-extensions-for-github — Come across this recently. A great list of extensions for GitHub.
  • octokit — Great list of libraries that abstract GitHub’s API, allowing you to get set up within minutes writing your own code.

If you still want to supercharge your workflow there is one more thing you can do… and that’s build your own app.

#3. Building your own app

Photo by Randall Bruder on Unsplash

There will be times when you can’t find a solution out the box to meet your requirements. Luckily for us, GitHub has an awesome API.

Even better they have a framework to create GitHub Apps….

Let’s say hello to Probot.

Probot

https://probot.github.io/

Probot is a framework to build GitHub Apps.

I had a requirement that required automatic comments on issues and pull requests. Within a couple of hours, I had something deployed, tested and running against our repository. If you’re interested you can check out my app here : Auto-comment.

I found the documentation for Probot excellent. If you want to do something custom or start to play with GitHub Apps I highly recommend you get started with Probot.

Another great set of tools are from Octokit.

OctoKit

https://developer.github.com/v3/libraries/

Octokit has some awesome libraries to help you integrate with GitHub.

I recently used Octokit to write an app that integrates GitHub & Jira. (which is hopefully open sourced soon). Every time an issue or pull request is opened or closed the Jira ticket is handled automatically & sharing comments between tickets.

My experience with Octokit was great. If your looking at writing something to integrate with GitHub take a look at OctoKit. Within hours you can get something together and running against your GitHub repositories.

🎉🎉🎉

That’s it!

We covered features you can get out the box with GitHub, some apps/repos to checkout and ways to build out your own ideas.

If you found this story useful please feel free to 👏 and send some love.

If you’re using other tools or workflows with GitHub, I would love to hear about them. Get in contact! ✉️

Thanks for reading 👋👋

🎉🎉🎉

--

--

David Boyne
Compare the Market

Music Loving 🎹, Father 👨‍👩‍👦‍👦, In with ❤️ JavaScript 🐱.