Avoid infinite build loops

TeamCity and GitHub are awesome together. TeamCity will build all your Git branches and GitHub will notify TeamCity whenever there's a push to your repository.

So what's the problem? In a nutshell: infinite loops caused by build tagging.

When TeamCity tags a build, GitHub notifies TeamCity that there's a new branch. So TeamCity builds it. And tags it. And GitHub notifies TeamCity that there's a new branch. So TeamCity builds it. And so on.

How do I use this this thing?

  1. Fill in the details below.
  2. Paste the generated URL into GitHub's TeamCity service Base url field.


How do I fix the root cause?

In the longer term, pester GitHub. Or send a pull request for GitHub's teamcity service. Unfortunately, I need a fix now, so here it is.

How does it work?

We do a man-in-the-middle attack between GitHub and your TeamCity server and allow you to filter branches based on a regular expression.

If the branch matches your regex, we do nothing and your TeamCity server will never see the notification. If the branch does not match your regex, we pass it on to your TeamCity server.

Do you see my TeamCity credentials?

Yep. But if your TeamCity server is publicly-visible and only using HTTP (the most common configuration) then so can the rest of the world.

This site is available via both HTTP and HTTPS (and you should use the latter). Your TeamCity server is hopefully available via HTTPS, too. If you do that then app will still be able to see your password (you did know that TeamCity uses Basic auth, right?) but nobody else will.

Do you keep my TeamCity credentials?

Nope. Your credentials are passed straight through from GitHub's GET request. They're not stored, logged or cached anywhere. I don't want them. I just want my builds to work and since I was publishing this app for myself I've published it for everyone else, too.

You can trust me on that or you can take a look at the source code for this app on GitHub.

If you're paranoid, you could even clone it and run your own - just be responsible with other people's credentials.

But this is an awful hack!

Yep. But I need it *now* and it works.