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

# CI/CD Integration

> Automate security scanning in your continuous integration and deployment pipelines

## Overview

VulnZap integrates with GitHub Actions to provide automated security scanning in your CI/CD pipeline.

**Key Features:**

* Auto-detects repository URL, branch, and commit from GitHub context
* Streams scan results directly in job logs
* Simple one-step configuration
* Zero additional setup required

## VulnZap CLI Scan Action

This GitHub Action runs a VulnZap scan via the VulnZap CLI and streams results in the job logs. The action auto-detects repository URL, branch, and commit from the GitHub context—you only provide the API key.

### Quick Setup

Create `.github/workflows/vulnzap.yml`:

```yaml theme={null}
name: VulnZap Security Scan

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

jobs:
  security-scan:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v4

      - name: Run VulnZap Scan
        uses: VulnZap/vulnzap-cicd@v1
        with:
          api-key: ${{ secrets.VULNZAP_API_KEY }}
```

### Action Inputs

<ParamField path="api-key" type="string" required>
  Your VulnZap API Key
</ParamField>

### How It Works

The action automatically:

* Derives the repository URL as `https://github.com/${GITHUB_REPOSITORY}`
* Passes `GITHUB_REF_NAME` (branch name) to the CLI
* Passes `GITHUB_SHA` (commit hash) to the CLI
* Installs and runs `npx vulnzap@latest` with the correct parameters
* Streams scan results to the job logs in real-time

<Info>
  Make sure Docker/network access is available so `npx vulnzap@latest` can install and run.
</Info>

### Setting Up Secrets

Add your VulnZap API Key as a repository secret:

<Steps>
  <Step title="Open Repository Settings">
    Go to your repository's **Settings** → **Secrets and variables** → **Actions**
  </Step>

  <Step title="Create New Secret">
    Click **New repository secret**
  </Step>

  <Step title="Add API Key">
    * Name: `VULNZAP_API_KEY`
    * Value: Your API key from [vulnzap.com/dashboard](https://vulnzap.com/dashboard)
    * Click **Add secret**
  </Step>
</Steps>

### Branch Protection

Require VulnZap checks to pass before merging:

<Steps>
  <Step title="Open Branch Settings">
    Go to **Settings** → **Branches** → **Branch protection rules**
  </Step>

  <Step title="Add Rule">
    Add rule for your `main` branch
  </Step>

  <Step title="Enable Status Checks">
    * Enable **Require status checks to pass before merging**
    * Select **VulnZap Security Scan** from the list
    * Save changes
  </Step>
</Steps>

## Next Steps

<CardGroup cols={2}>
  <Card title="CLI Reference" icon="terminal" href="/integration/cli">
    Complete command-line documentation
  </Card>

  <Card title="Dashboard Guide" icon="chart-line" href="/features/dashboard">
    View findings in the web dashboard
  </Card>

  <Card title="IDE Integration" icon="code" href="/features/ide-integration">
    Real-time scanning while coding
  </Card>

  <Card title="Deployment Options" icon="server" href="/team/deployment-options">
    Self-hosted and on-premises options
  </Card>
</CardGroup>
