> ## Documentation Index
> Fetch the complete documentation index at: https://docs.scandrix.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# CI/CD Pipeline Integration

> Embed ScanDrix automated review quality gates into GitHub Actions, GitLab CI, and CircleCI.

You can run ScanDrix directly inside automated deployment pipelines to enforce pre-merge security gates and block pull requests containing critical vulnerabilities.

## GitHub Actions

Create `.github/workflows/scandrix.yml` in your repository:

```yaml theme={null}
name: ScanDrix Code Review Gate

on:
  pull_request:
    branches: [main, master, develop]

jobs:
  review:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - name: Install ScanDrix CLI
        run: curl -fsSL https://scandrix.dev/install | bash

      - name: Run Review Gate
        env:
          SCANDRIX_API_KEY: ${{ secrets.SCANDRIX_API_KEY }}
        run: |
          scandrix review \
            --branch origin/${{ github.base_ref }} \
            --fail-on critical \
            --json
```

## GitLab CI/CD

Add the following job to `.gitlab-ci.yml`:

```yaml theme={null}
scandrix_review:
  stage: test
  image: alpine:latest
  only:
    - merge_requests
  before_script:
    - apk add --no-cache curl git bash
    - curl -fsSL https://scandrix.dev/install | bash
  script:
    - scandrix review --branch origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME --fail-on critical
  variables:
    SCANDRIX_API_KEY: $SCANDRIX_API_KEY
```

## CircleCI

Add a review step in `.circleci/config.yml`:

```yaml theme={null}
version: 2.1
jobs:
  scandrix-gate:
    docker:
      - image: cimg/base:current
    steps:
      - checkout
      - run:
          name: Run ScanDrix Quality Check
          command: |
            curl -fsSL https://scandrix.dev/install | bash
            scandrix review --branch origin/main --fail-on critical
workflows:
  build-and-test:
    jobs:
      - scandrix-gate
```

> [!TIP]
>
> Set `--fail-on critical` to ensure only high-risk vulnerabilities (SQL injection, leaked credentials, broken authorization) block pipeline execution, while style and minor architectural recommendations are posted as non-blocking comments.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.