Skip to content

docs/Guides

CI and GitHub Action

Audit a staging site on every push, upload findings to code scanning and fail on a severity you choose.

#GitHub Action

.github/workflows/kagicyber.yml
name: KagiCyberon: [push]permissions:  contents: read  security-events: writejobs:  audit:    runs-on: ubuntu-latest    steps:      - uses: kvdzidev/kagicyber@v1        with:          url: https://staging.example.com          fail-on: high          sarif: true

The action writes the Markdown report to the job summary, saves the HTML, JSON and fix-prompt files in the workspace (upload them with actions/upload-artifact to keep them) and, with sarif: true, uploads the findings to GitHub code scanning.

#Inputs

InputDefaultPurpose
urlrequiredSite to audit, a domain or URL
fail-onemptyFail at or above this severity: critical, high, medium or low
fail-underemptyFail when the compliance score is below this number
profilebalancedRequest profile: quiet, balanced or fast
countrydetectedJurisdiction used for maximum penalties, for example PL or DE
includeemptyExtra jurisdictions, for example DE,FR
baselineemptyAn earlier JSON result; only new findings fail the job
sariffalseUpload findings to code scanning (needs security-events: write)
versionemptyA kagicyber version from npm; empty runs the code of the action release

#Outputs

kagicyber-report.md, kagicyber-report.html, kagicyber-report.json, kagicyber.sarif and kagicyber-fix-prompt.md.

#Monthly audit with a baseline

.github/workflows/kagicyber.yml
on:  push:  schedule:    - cron: '17 6 1 * *'jobs:  audit:    runs-on: ubuntu-latest    steps:      - uses: actions/checkout@v4      - uses: actions/cache@v4        with:          path: baseline.json          key: kagicyber-baseline-${{ github.run_id }}          restore-keys: kagicyber-baseline-      - uses: kvdzidev/kagicyber@v1        with:          url: https://www.example.com          fail-on: high          baseline: ${{ hashFiles('baseline.json') != '' && 'baseline.json' || '' }}          sarif: true      - run: cp kagicyber-report.json baseline.json        if: always()

#Repositories

terminal
npx kagicyber scan . --sarif kagicyber.sarif --fail-on high

Every repository finding points at its file and line, so code scanning shows it inline. Other CI systems can read --junit output.