Set a primary branch
A primary branch is the base or target branch for pull requests and merge requests. It is usually referred to as a default branch or trunk by your source code manager (SCM). Typical names for a primary branch include dev
, production
, or develop
.
In many cases, Semgrep automatically detects primary branches when they first scan your project. If you have projects (repositories) with unique primary branch names, you can set them through the Semgrep web app.
A primary branch enables Semgrep to filter your findings by branch and to accurately deduplicate findings. The primary branch is also used to analyze the deployment of secure guardrails to your developers; findings fixed before they are merged into the primary branch reduces the overall production backlog.
The following video provides an introduction and walkthrough: