Get Started
DocsTrack 4github-action
/llms.txt
CI/CD & SARIF3 min readbrevio-core v0.11.1

GitHub Action (Brevio-Ventures/brevio-core@v0.11.1) & SARIF v2.1.0 Code Scanning

Plain-English Summary (For Anyone)

A GitHub Action that checks the lines a pull request adds and comments on findings

Add one step to a GitHub workflow. The Action installs brevio-core 0.11.1, scans the lines the pull request adds, writes a job summary and annotations, and posts one comment while there are findings. With a required check, a finding keeps the pull request from merging.

Why this matters:
It needs no secret and makes no model call.
With `sarif: true` it uploads the findings to GitHub code scanning.
Most of a run is the checkout and the install, because the scan reads only the added lines.
When to use:Add it as `.github/workflows/brevio-core.yml` to check every pull request. `brevio-core init` writes the same workflow for you.
Technical Contract (For Engineers)
Line-level rules
CLI Invocation Signature:
uses: Brevio-Ventures/brevio-core@v0.11.1 (runs brevio-core scan --diff <base> --format markdown)
Latency / Execution
Not measured for 0.11.1
Token Cost
No model call. No API key.
Exit Codes
0 = nothing found; 1 = findings (fail-on decides which findings fail the check)
Artifacts & Files Generated:
job summarypull request commentSARIF upload (sarif: true)
Visual Execution Pipeline
5-Stage Progressive Flow
013 events
Trigger
Workflow runs on pull_request, merge_group or push
02Git history
Checkout
actions/checkout with fetch-depth: 0 so the base commit exists
03Added lines
Scan
brevio-core scan --diff <base> on the lines the change adds
04sarif: true
Report
Job summary, annotations, one comment, optional SARIF upload

Adding the GitHub Action

In Plain English:Save this as `.github/workflows/brevio-core.yml`.
The Action `Brevio-Ventures/brevio-core` installs exactly brevio-core 0.11.1 from PyPI (its `package-version` input defaults to the Action's own release) and scans the lines the pull request adds. `fetch-depth: 0` matters: the scan compares the change with its base commit, which must be in the checkout. The Action runs on `pull_request`, `merge_group` and `push`, and stops with an error on any other event.
Standard Workflow Configuration
Fixed (After)Exit 0
name: brevio-core
on:
  pull_request:
  merge_group:
permissions:
  contents: read
  pull-requests: write     # the comment on the pull request
jobs:
  brevio-core:
    name: brevio-core
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
        with:
          fetch-depth: 0
      - uses: Brevio-Ventures/brevio-core@v0.11.1

SARIF v2.1.0 Code Scanning Integration

In Plain English:Findings can also show up in the GitHub Security tab.
`brevio-core scan --sarif FILE` writes a SARIF 2.1.0 log with one result per finding (`ruleId`, `level`, `message` and a location). In the Action, set `sarif: true` and give the job `security-events: write`; the Action uploads the findings itself, and a repository without code scanning does not fail. Set `comment: never` if you want code scanning and no comment. On a pull request from a fork the token is read-only: the Action says so in the summary and does not fail.
Code Scanning Without a Comment
Fixed (After)Exit 0
permissions:
  contents: read
  security-events: write
jobs:
  brevio-core:
    name: brevio-core
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
        with:
          fetch-depth: 0
      - uses: Brevio-Ventures/brevio-core@v0.11.1
        with:
          sarif: true
          comment: never

Pinning the Action to a Commit SHA

In Plain English:A tag can move; a commit SHA cannot. Pin the Action to a SHA if every run must be repeatable.
Look up the commit of the release tag with `git ls-remote https://github.com/Brevio-Ventures/brevio-core refs/tags/v0.11.1`, then write `uses: Brevio-Ventures/brevio-core@<the commit SHA printed above> # v0.11.1`. The checkout line in the workflow above is a separate pin: actions/checkout at fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 is v5.1.0. `@v0` is a moving major tag until 1.0: the easiest to write and the least predictable.

Adopting It on a Repository With Existing Findings

In Plain English:Got an existing repo with many findings? Record them once so the check fails only on new ones.
Run `brevio-core baseline` once, then commit `.brevio/baseline.json`. The default `fail-on: new` hides baselined findings and fails only on new ones. For a trial week use `fail-on: none` (report only). `fail-on: error` fails only on error-level findings, with levels from brevio-core.toml. The test-custody rules R20.1 to R20.5 are not part of the Action unless you set the `custody` input (`report` or `fail`, a preview).

Interactive Rule Explorer

Explore the brevio-core rules and load their examples into the panel on the right.

129 / 129 rules