Skip to main content

CI Quality Gates

Vipr does not use a separate gate command. The main analyze command can fail the process when scores drop too low or when critical findings are present.

Gate conditions

Flag What triggers failure
--fail-threshold <score> Any analyzed file scores below the configured threshold
--fail-on-critical Any critical-severity insight is reported

The command exits with code 1 when either gate trips. Otherwise it exits with code 0.

vipr analyze "src/**/*.{ts,tsx}" \
  --format json \
  --output vipr-report.json \
  --fail-threshold 70 \
  --fail-on-critical \
  --quiet

This keeps logs quiet, writes a machine-readable artifact, and lets the CI job fail on the same signal developers see locally.

GitHub Actions

Add a single analysis step to your workflow:

- name: Run Vipr analysis
  run: |
    npx --yes @vipr/cli analyze "src/**/*.{ts,tsx}" \
      --format json \
      --output vipr-report.json \
      --fail-threshold 70 \
      --fail-on-critical \
      --quiet

If you want faster feedback on pull requests, narrow the input set to files changed since your base branch:

vipr analyze "src/**/*.{ts,tsx}" --changed origin/main --format json --output vipr-report.json

Use the changed-files mode as a fast path, not as a replacement for a broader baseline job.

Pull request comments

Use --format markdown when you want a human-readable artifact for pull requests:

vipr analyze "src/**/*.{ts,tsx}" \
  --format markdown \
  --output vipr-comment.md \
  --quiet

The Markdown output works well with gh pr comment or a GitHub Action such as peter-evans/create-or-update-comment.

Exit codes

Code Meaning
0 The analysis completed and all configured gates passed
1 A gate tripped or the command could not complete
Documentation