How vidoc ci works
vidoc ci runs without questions. It does these steps:
- It uploads the new and changed files of the current folder to Vidoc, as
vidoc scandoes. - It finds the default branch from the
originremote. If the CLI cannot read the remote, it usesorigin/main, ororigin/masterif only that branch exists. - It finds the files that the commits of the current branch changed, compared with the default branch (from the merge base). Uncommitted changes are not included.
- It scans only these files and waits until the scan is complete.
- It prints the validated issues that Vidoc has for the branch, and a summary by severity.
vidoc ci prints “No scannable files matched the selected scope in the current directory.” and ends without a scan.
The list in step 5 contains all validated issues of the branch, not only the issues in the changed files. The CLI does not filter the list by status.
Requirements for the CI job
- Full Git history.
vidoc cineeds the default branch and the merge base. Use a full clone (for examplefetch-depth: 0on GitHub Actions). - A branch name. Many CI systems check out a detached HEAD. Without a branch name, Vidoc uses the commit SHA as the branch name. Run
git checkout -B "<branch name>"beforevidoc ci. - Network access. The runner must reach the Vidoc API. On a self-hosted installation, runners that your CI provider hosts (for example GitHub-hosted runners or Bitbucket Pipelines) run outside your network.
- Credentials. Keep the API key in the secret store of your CI system as
VIDOC_TOKEN. For a self-hosted installation, also setVIDOC_API_URLtohttps://api.<your-domain>. On Vidoc Cloud,VIDOC_API_URLis optional. The default ishttps://api.vidoc.dev.
Options
vidoc ci accepts the same options as vidoc scan: -f, --only-indexing, -p, --api-url, --token, -c, and --debug. Refer to Scanning options. In CI, use environment variables for the key, not --token, so that the key does not show in the job log.
Exit codes
vidoc ci does not fail the job when it finds issues. To fail the job, refer to Fail a pipeline on issues.
Examples
- GitHub Actions
- GitLab CI
- Bitbucket Pipelines
- Go to Settings > Secrets and variables > Actions in the repository.
- Add
VIDOC_TOKENas a repository secret. - Self-hosted only: add
VIDOC_API_URLas a repository variable. - Add a workflow, for example
.github/workflows/vidoc.yml:
pull_request events, GitHub Actions checks out a detached HEAD. $GITHUB_HEAD_REF is the name of the PR source branch.On GitHub Actions,
vidoc ci can print “No Github token provided. Skipping comment.” You can ignore this message. PR comments come from the GitHub integration.Fail a pipeline on issues
vidoc ci can return exit code 0 even when a scan fails. To enforce a rule, replace the vidoc ci step with the script below. Run the script with Bash after the checkout and CLI installation steps.
Before you run it:
- Set
VIDOC_TOKEN,VIDOC_API_URL, andVIDOC_CODEBASE_IDin CI. Set the API URL explicitly for both Cloud and self-hosted jobs. Refer to API addresses. - Get the repository ID with
GET /v1/codebase. - Check out the intended commit on a named branch, as in the pipeline examples above. Use a clean checkout and install
curlandjq. - Run only one scan at a time for this repository and branch while the gate runs. Issue results are the current branch state, not an immutable snapshot of a scan.
Scan started with ID: message from CLI 0.1.21. Pin the CLI version for a required CI check, and verify this message when you upgrade. A run with no scannable changes returns no scan ID, so this gate fails. Define an explicit skip rule in your CI if your team permits that case.
Manual and CLI scans can have no commit SHA in the API. The scan ID ties the completion check to this invocation; it does not certify a commit snapshot. To change the finding rule, change severity and status. Refer to List issues.
Related pages
Configuration
Environment variables and precedence.
Issues API
Read and filter issues.

