Skip to Content
SCA & DependenciesBranch-Level Scanning

Branch-level scanning

You can scan any branch of a connected repository, not only the default branch. Each scan records the branch it ran on, and dashboards can be scoped to one branch.

Scan a branch

If the branch list cannot be loaded, the dialog says Couldn’t load branches and offers Retry. When a default branch is on record it falls back to that branch. Otherwise you must retry before you can start.

Branch names may contain letters, digits, ., _, / and - (up to 255 characters). They cannot start with - or contain ...

New findings versus the baseline

A scan of the default branch updates that branch’s baseline. A scan of any other branch is compared against the default-branch baseline, and each finding is marked new or existing. The scan’s results page then reports N new vs <default>. If the default branch has no baseline yet, every finding on the branch counts as new, so scan the default branch first. SCA-only dependency scans are not compared with the baseline.

To compare the latest scans of two arbitrary branches, use Branch comparison.

Scope dashboards to a branch

The Select branch dropdown appears on the Dependencies (SCA) dashboard and its views, the Security Center, Code Quality, and the repository dashboard. Choosing a branch scopes findings, charts, trends and summary cards to the latest scan of that branch. The default branch is marked with a dot.

Schedule scans of a branch

Two schedulers let you pin a branch:

WhereFieldNotes
Scans → Schedules (/dashboard/scans/schedules)BranchRecurring Smart or Deep scans. See Scheduled scans.
Dependencies → Settings → Schedule (/dashboard/sca/settings?show=schedule)Branch to scanRecurring dependency scans. The branch is checked against your Git provider when you save, and every run stays on that branch until you edit the schedule. See Scheduled scans.

Default branch

The default branch is recorded on the repository. It is used whenever a scan or schedule does not name a branch. If no default branch is on record, scans use main.

Permissions

Starting a scan on any branch needs the Member role or above. API keys need the write:scans scope. Viewing branch-scoped results needs normal read access to the repository.

API

List the branches the dialog offers:

GET /api/repositories/{repo_id}/branches
[ { "name": "main", "default": true }, { "name": "develop", "default": false } ]

Start a scan on a branch (omit branch to use the default branch):

POST /api/scans/trigger/{repo_id} Content-Type: application/json { "type": "smart", "branch": "develop" }

Branch-scoped reads take ?branch=<name>, for example GET /api/sca/findings/{repository_id}?branch=develop and GET /api/dashboard/repository/{repo_id}?branch=develop.

Limitations

  • Up to 100 branches are fetched per repository from the provider.
  • If CodeStax holds no usable provider credential for the repository, the list contains only the recorded default branch.
  • Branch listing for GitLab works with gitlab.com repositories.