Set up regular scans

Things you'll need to know while setting up regular scans.

Once you are happy with the results, you can set up Omlet CLI to run as part of your build process or schedule regular CLI runs. This way, you will see changes in usage over time and track the new components being added, removed, or updated.

To run Omlet CLI in an automated environment, you'll need to pass the Omlet access token to an environment variable.

You can generate an access token by running:

npx @omlet/cli login --print-token

Then, set the access token to an environment variable named OMLET_TOKEN. Omlet CLI will use this environment variable to upload scans. Here are the sample .yaml snippets for commonly used CI platforms:

name: Omlet CLI scan

on:
  push:
    branches:
      - main

jobs:
  analyze:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout code
        uses: actions/checkout@v2
        with:
          fetch-depth: 0

      - name: Set up Node.js
        uses: actions/setup-node@v2
        with:
          node-version: 20

      - name: Install dependencies
        run: npm ci

      - name: Run analyze
        run: npx @omlet/cli analyze
        env:
          OMLET_TOKEN: ${{ secrets.OMLET_TOKEN }}

Last updated