Skip to main content
Version: Config V2

GitLab - Scan your source code for feature flags

This section describes how to use the ConfigCat CLI in GitLab CI/CD to automatically scan your source code for feature flag and setting usages and upload the found code references to ConfigCat.


  1. Create a new ConfigCat Management API credential and store its values in GitLab's CI/CD Variables with the following names: CONFIGCAT_API_USER, CONFIGCAT_API_PASS.

    Gitlab secrets
  2. Get your selected Config's ID.

  3. Create a new or open your existing .gitlab-ci.yml file, and put the following job into it. Don't forget to replace the PASTE-YOUR-CONFIG-ID-HERE value with your actual Config ID.

    stage: deploy # the job will run in the deploy phase, but you can choose from any other phases you have
    name: configcat/cli:1.9.2
    entrypoint: ['']
    - configcat scan $CI_PROJECT_DIR
    --runner="ConfigCat GitLab Job"
  4. Commit & push your changes.

Scan reports are uploaded for each branch of your repository that triggers the job.