Branch support – Closed Beta
Snyk will always test whatever is set as the default branch of a project – usually this is the
master branch, but not always.
If you require Snyk to test a non-default branch, we have an implementation of this functionality
available. It’s currently in closed Beta behind a feature flag while it is being developed, which is
why you won’t find it documented on our site. There are a couple of quirks with it that we’re
working on improving before releasing it to everyone, and we’ll describe those.
How to use our branch feature
Once we’ve enabled the flag, you will be able to test non-default branches of projects. To do
this, go through the Add Projects flow for your chosen source code manager (in this example,
we’re using GitHub), and you’ll see a new option to monitor a branch.
In this example, I am going to monitor the develop branch of repo 1 and repo 2.
If target files are detected on this branch, a project will be created.
If a single branch is monitored, there will be a single project for each detected manifest file.
If I go back through the same Add Project flow, but this time with a different branch, and Snyk
detects manifest files in that, I will see additional projects listed under the same repo.
It’s worth bearing this in mind if you have repos with dozens of manifest files, because each
manifest file on each branch generates a separate project.
This is particularly important when considering commit statuses, because each monitored
branch will generate a separate commit status.
We are currently working on improvements to our branch support feature before we release this
to everyone. The first version will allow anyone to monitor any single branch on their app
(custom branches). The second version will allow anyone to monitor multiple branches of the
same app (multiple branches).