Skip to content

Scanner reports ​

A scan job that ran before the review, Trivy, Semgrep, CodeQL, ESLint or SonarQube, wrote a report of what it found. --sarif and --sonarqube hand that report to a review: the issues it lists on the change go to the panel of the profile it names, as candidates, and are judged by the same blind votes as the finder's findings. This page says what quorum reads, the flags, how each format is read, how a path is placed against the change, what the panel sees, every limit that leaves a gap, the two advisory flags that watch a change for what could silence a scan, and a CI workflow whose scan job writes the reports.

What quorum reads, and never runs ​

  • Files only. Quorum reads the file a flag names and never runs a scanner, calls a scanner's server or reads a path a report names. The scan job is the CI's, and it runs before the review.
  • As data, never as configuration. A report is text the change can influence, since the change's own code and files are what the scanner read. Each is read through the bounded reader, as a regular file and never through a link, at most 16 MiB; its text is cleaned and capped before a model reads it, a text that reads as a credential is never sent, and what a model reads of it is fenced as a claim, for the voters of its own candidate alone: What the panel sees.
  • A scanner never decides. Its issue is a candidate: it goes through the same panel as a finding and is kept or dismissed by the votes. A report can add candidates and facts to a review, and never removes a finding or lowers a verdict.
  • Nothing local is written out. No result, event, line or detail holds a report's path, a file name it lists or its text; they hold counts, hashes, code words and a cleaned scanner name.
  • A review that names no report gets no new gap, no new block and no new line.

The formats and the flags ​

FlagReadsFeeds
--sarif [<profile>=]<path>A SARIF 2.1.0 logThe named profile's panel
--sonarqube [<profile>=]<path>A saved response of SonarQube's api/issues/searchThe named profile's panel
--lcov <path>An lcov tracefile a test run wroteEvery profile that reads test coverage, not a profile of its own naming: Test coverage
--scan-root <dir>The absolute directory the scanners ran in, stripped from the absolute paths their reports name, a tracefile's too: The paths
bash
quorum --range "$BASE...$HEAD" \
  --sarif security=scan/trivy.sarif \
  --sonarqube security=scan/issues.json \
  --scan-root /src
  • Each report names its profile. security=trivy.sarif feeds the security profile and no other, and any profile that runs can be named, the built-in ones and one of your own alike. With one profile running, <profile>= may be left out. With several it must name a running one, so a report is never read for a profile by guess. To feed two profiles one file, name it twice.
  • A value that starts with a profile id and = names the profile. The id is lower case letters, digits, _ and -, starting with a letter. A file whose name looks like one is written with a path: ./a=b.sarif. Any other value is a path, relative to the working directory unless it is absolute.
  • The flags repeat, once for each report, at most 16 reports in all, --sarif, --sonarqube and --lcov together. The reports are read in the order of the flags, the --sarif ones first, then the --sonarqube ones and then the --lcov ones, and each report's place in meta.context.reports, and its number from 1 in the lines, follow that order, the scanner reports first. A tracefile is no scanner report, and the page on test coverage says what it is for.
  • --scan-root takes one directory, and only beside a report.

What an error looks like ​

ErrorWhenExit
Error: --sarif: must name a fileAn empty path, --sarif '', or a profile with no path, --sarif security=. --sonarqube has the same2, with the usage, before any config
Error: --sarif: takes at most 16 reports in allA seventeenth report, named at the flag of the seventeenth2, with the usage
Error: --scan-root: must be an absolute directoryA directory that does not start with /, or that holds an empty, . or .. segment, a trailing / aside2, with the usage
Error: --scan-root: takes one directoryA second --scan-root2, with the usage
Error: --scan-root: needs --sarif, --sonarqube or --lcovA scan root and no report2, with the usage
Error: --print-config: reads no report, so it takes no --sarif, --sonarqube, --lcov or --scan-rootAny of the four with --print-config, which reads no diff2, with the usage
Error: --sarif: names the profile "securty", which does not runA report for a profile that is not among the ones that run: a typo never drops a report silently2, no usage, after the config loads and before any git
Error: --sarif: must name a profile when several runA report with no profile while several run2, no usage, after the config loads and before any git

No message repeats a path or a value given, but a profile's id, which is named when it is safe to print. quorum mcp defines none of the four flags, so each is Unknown option there, exit 2: an agent's review reads the changes it names, and a scan is the CLI's. A report's file is never an exit 2: a file that is missing, a link, over 16 MiB or in no known format is a gap of the profile it feeds (The limits and the gaps), so a scan job that crashed costs its report and never the model's review.

maxScannerIssues is the one setting: how many issues on the change each profile's panel judges in one review, 50 by default: The outcomes and the cap.

Reading a SARIF log ​

The log is read as SARIF 2.1.0 reads it, its optional parts as optional, at most 20 runs and 25000 results in a run, GitHub's own limits: what is past them is not read, and the report is read in part. What the file held past them is counted, not dropped: the results of a run beyond its 25000, and every result of each run past the 20th, are notRead in the report's record, and the report's listed is what the file held.

  • A result is an issue when its kind is absent or fail. Any other kind, pass or informational, is counted as skipped, and so is no issue.
  • What is read of a result is its rule (ruleId, else rule.id), its level, its message and its first location: physicalLocation.artifactLocation.uri, region.startLine and region.snippet.text. Later locations, related locations and code flows are not read, nor is uriBaseId: The paths.
  • A location with an index and no uri is placed through the run's artifacts: the uri of the entry its artifactLocation.index names, read as any uri is. A uri the location states is read before its index. An index that is no whole number of 0 or more, is past the list or names an entry with no uri string, and a run with no artifacts list, leave the issue unmapped, and so does a locations that is no list: quorum cannot say where such an issue is. A result with no locations, an empty list, or a location that names neither a uri nor an index names no file, and is not in the change.
  • The message is message.text, else the rule's shortDescription.text. A result with neither, with no rule id, or whose line is no whole number of 0 or more, is counted as unreadable, and the rest are read.
  • The rule's text, which the voters of the issue read, is the first of the rule's help.text, fullDescription.text, shortDescription.text and name, found by the result's rule index (in the extension the result names, else the driver) and else by the rule's id.
  • A missing level is unknown, never ignorable. The level is the result's, else its rule's defaultConfiguration.level, else unknown. An issue of unknown severity is a candidate like any other and is capped last.
  • A run that failed is no clean run. A run with no results list at all (absent or null) is a scanner that failed, where an empty list is a clean run. A log whose every run has none is unreadable (no-results), and one with some, or with a run whose invocations say executionSuccessful: false, is read in part, since what the scanner did not scan is unknown.
  • Suppressions are recorded and never honoured. A result with a suppression whose status is accepted, or absent, is marked suppressed: SARIF sets no default for a status, and quorum reads a suppression with no status as in effect. One that is rejected or underReview marks nothing. It is a candidate all the same, since a suppression is the change's own comment or a baseline the change can edit. Its finding says marked suppressed in the summary and the line comment, and it is no SARIF suppression in the SARIF quorum writes: SARIF.
  • The scanner is the first run's tool.driver.name; the commit a run states, versionControlProvenance[].revisionId: The commit.

Reading a saved SonarQube response ​

The response is what api/issues/search answers, saved to a file by the scan job: its issues, components, rules, total and paging, read leniently, so a field a version adds is no trouble. A response with no issues list is no response and is unreadable.

  • An issue's file is its component's path in components, else the component's key less its project key and the colon. An issue on the project itself names no file and is not in the change.
  • Its line is line, else textRange.startLine; an issue with neither has no line of its own and is file-level: The outcomes and the cap.
  • An open issue is one whose issueStatus is OPEN or CONFIRMED, or, with no issueStatus, whose status is OPEN, CONFIRMED or REOPENED. Any other, resolved, closed, accepted or a false positive, is skipped: a decision a person with SonarQube's rights recorded outside the change is honoured, and a suppression the change writes is not.
  • Its level is the highest of its impacts severities, else its severity: BLOCKER, CRITICAL and HIGH are error, MAJOR and MEDIUM are warning, MINOR, INFO and LOW are note, and any other is unknown.
  • Its rule's text is the rule's name in rules, when the response holds it. The scanner is SonarQube, and a response states no commit.
  • A response that holds fewer issues than its search found is read in part: its total (else paging.total) is above the issues it holds, so the file is one page of the answer. At 10000 the gap says that is SonarQube's own cap on a search, and to narrow the query.

The paths ​

A report names a file as its scan job saw it, so quorum makes the path the repository's own by rules that never open a file and never match by suffix:

  1. A SARIF uri with a scheme other than file, or a file URI whose host is not empty or localhost, is unmapped. A uri is percent-decoded once, and one that does not decode is unmapped. A SonarQube path or any other path is never decoded. A path that holds a NUL, another control character below the space, or DEL, as it was written or once decoded, is unmapped.
  2. An absolute path under the scan root loses that prefix. Any other absolute path is unmapped.
  3. A leading ./ is dropped, and a path with an empty, . or .. segment is unmapped.
  4. The scan root's own place below the repository's top level, with its trailing /, goes in front of the path.
  5. The result is compared as it is with the diff's own paths. An issue whose path matches is on a file of the change; the others are counted and never reviewed.
  • The scan root is --scan-root when given, else the repository's top level, for every git source: a range, the local or staged changes, or a path review. A job that checks the repository out to the runner's default directory and scans there has the top level as its root, so it needs no flag. A scan in a container names its own: --scan-root /src. It is never opened or resolved through the file system: it is compared as a string with the top level git prints (git rev-parse --show-toplevel), so name it as git does, a symbolic link not followed.
  • A monorepo package's place. A package's scan writes paths relative to the package, such as src/a.ts. Named --scan-root <top>/packages/app, with <top> the repository's top level, the root's place below it is packages/app/, so the path becomes packages/app/src/a.ts, the file the diff names. A scan root outside the top level, a container's /src, stands for the top level itself and adds no place.
  • A diff file or standard input has no top level. A review of one has no repository to ask, so an absolute path is placed only under a --scan-root, and a relative path is read as the repository's own. Without a root, an absolute path is unmapped.
  • Windows paths. A backslash is a character like any other, since a file name may hold one, and a Windows drive path is no absolute path quorum reads, so an absolute path a Windows scan wrote is unmapped or names no file of the change, and a --scan-root of C:/src is refused. Convert the paths to relative paths with forward slashes in the scan job. The git sources run on Linux and macOS, and a diff piped in on Windows has no top level.
  • An unmapped path makes the report partial, since an issue that quorum could not place may sit on a changed file: an absolute path outside the scan root is how a whole report once made every file look unreported. A SARIF location quorum cannot place, such as an artifact index that names no entry, counts the same.

The commit ​

A scan reports the files it read, so a report made at another commit says nothing of this change. When a report states the commit it was made at, quorum checks it:

  • The reviewed commit is a range's head, a path review's commit and HEAD for the local and staged changes. A commit a report states as a hexadecimal prefix of 7 to 64 digits, in any case, matches it when the reviewed commit starts with it.
  • A report that names another commit is refused whole, as unreadable with the reason another-commit: no issue of it is used. So is one that states a revision that is no commit id, such as a branch name, since it cannot be checked. A report that states none is not checked, and one a stale scan wrote can pass: the scan job must scan the commit the review is of.
  • A diff file or standard input names no commit, so its reports are not checked, and meta.context.reports records the commit each one states.
  • A local review reads files the working tree may have changed since HEAD. A scan of --local or --staged must therefore be run on the working tree as it is reviewed, since no scanner states the state of the working tree and quorum cannot tell a stale scan of it from a fresh one.

The outcomes and the cap ​

Each issue of a report ends in exactly one outcome, counted in meta.context.reports, in this order:

OutcomeWhen
skippedThe reader counted it as no open issue: a SARIF result of another kind, a SonarQube issue that is not open
unreadableThe reader could not read the entry: a line that is no whole number, no message or no rule id
heldIts message, rule text, rule id or scanner name reads as a credential: no model is sent it, whatever else it holds
unmappedIts path is one quorum cannot place: The paths
left outIts file is one the review left out: excluded, held as a secret, binary or a submodule
not in the changeIt names no file of the diff, or none
usedA candidate the panel judges: its line is within two rows of a row the change adds or removes, or it has no usable line (below)
on an unchanged lineAny other line of a file of the diff: a pre-existing issue elsewhere in a touched file is counted and not reviewed
cappedA candidate past the profile's maxScannerIssues
  • What the reader did not read ends in no outcome: a result past a run's 25000, a result of a run past the log's 20th, an issue of a response past its 25000. The record counts it in notRead, beside the outcomes, and listed, what the file held, is the nine outcomes and notRead added, so 1 of 25030 issues used says what the file held, and the gap says how many of them were not read: 30 of its 25030 issues were not read.
  • A file-level issue is one with no usable line: no region, no start line, a start line of 0, or a Trivy result at line 1, since Trivy writes line 1 for any result it cannot place, so a real line 1 cannot be told from the fallback. When the change touches its file, it goes on the file's first changed line, and its verdict says file-level. Any other scanner's line 1 is a line.
  • Near the change is the rule a profile that reviews changed lines only applies to a finding: a line within two rows of a row the change adds or removes. A change can make an unchanged line wrong, a check removed above it for one, so the lines around it count.
  • A candidate is a finding detail checked as any is: its file is the diff's path, its category the rule's id, its summary the scanner's message, cleaned and capped at 500 characters, and its evidence the diff's lines, read by the harness. The report's snippet is only the quote the evidence is compared with. It joins the finder's findings before dedup, the finder's first, so a scanner's issue and a finder's finding on one line are two verdicts when their categories differ. A profile whose research failed or asked nothing still judges its candidates, since the panel does not depend on research.
  • The cap is maxScannerIssues, 50 by default, a cap of its own beside findingsCap: a candidate is counted in this one and a finder's finding in that one, so a flood of issues never pushes a finding out and the reverse. A panel judges at most the sum of the two caps. The candidates are ordered by level, error, warning, note, none and then unknown, then in the order of the reports and each report's own order, and those past the cap are capped: they are never reviewed, and the profile records an issues-capped gap. Raise it in the config: Configuration.
  • What a person reads. The log says each report's counts in one line, context: report 1 sarif "Trivy" for security: 1 of 14 issues used (1 file-level); 13 not in the change, each outcome that is not 0 after the first, and ; read in part when it was, and the text report and the Markdown summary list the same words. A report that could not be read says so: context: report 1 sarif for security: could not be read. The summary on stderr ends with counts the reports read, read in part and unreadable (reports: 1 read, 1 could not be read), and the result records each, with its hash and its counts: A scanner report's record.

What the panel sees ​

A candidate is voted on as a finding is, blind, one vote for each lens, and its confidence is computed from the votes. Its voters, and no other, read two blocks of its own, each fenced as data and described in the data notice as what it is:

  • Its claim, in place of the finder's: Finding: <file>:<line> [<rule id>], Reported by: <scanner>, rule <rule id> and Claim by the scanner (unverified): <message>, each name's hidden characters shown as <U+XXXX>. The notice calls it the scanner's claim, unverified, that may be wrong or planted.
  • Its rule's text, cleaned and capped at 2048 characters, the scanner's own description of the rule it reports, as its report gives it.

A candidate's level and whether its report marks it suppressed are not sent: no study measured them as a voter's input, and a suppression is the change's own word. No report text reaches the finder or any system message. The finder reviews the diff as it always did, and a model's finding takes no scanner text.

Dismissed issues and the public view ​

A scanner's issue the panel dismisses stays in the result with its votes, in discarded, as any discarded finding does, so a real issue a panel cleared is in front of the reviewer who reads the result. The public view lists these dismissed issues, with their public votes, and still withholds and only counts the finder's: the finder's discarded findings tell an attacker what the finder saw and the panel cleared, where a scanner's issue is no such secret, since the scan ran on the attacker's own code and its report is theirs to read. What remains is the per-lens keep of a dismissed issue, which shows which refutation angle a planted text swayed, as a kept finding's already does: The public view. The text report and the Markdown summary list them, and SARIF counts them in a notification: Reports for GitHub.

The limits and the gaps ​

Every limit is said as N of M used and never read as complete. A report that is not read whole is a gap of each profile it feeds, in fixed words that name the report by its place and never by a file name:

ReasonOne forWhenThe detail
report-unreadableA reportNothing of it was usedreport <n> (<format>) could not be read: <why>
report-partialA reportPart of it was not read or not placedreport <n> (<format>) was read in part: <why>, joined by ;
issues-cappedA profileCandidates fell past maxScannerIssues<k> of <m> scanner issues on the change were not reviewed (the cap is <c>)
  • Unreadable, by cause: the file does not exist (missing), the file cannot be read (cannot-read), it is a symbolic link or no regular file, which quorum does not read (not-a-file), it is over 16 MiB (too-large), it is no SARIF 2.1.0 log or it is no saved api/issues/search response (not-the-format, which a file that is no UTF-8 text is too), no run holds a result list, so its scanner failed (no-results) and it states the commit <short>, and the review is of <short> (another-commit).
  • In part, by cause: it holds <h> of the <t> issues its search found (truncated), <r> of its <t> results were not read (too-many; issues for a SonarQube response, and for the runs a log holds past its 20th <q> of its <n> runs, joined to the results by and), a run says its scanner failed, or holds no result list (scanner-failed), <u> of its <l> entries could not be read, <m> issue(s) name a path quorum could not place in the repository and <k> issue(s) hold what reads as a credential, so no model was sent them.
  • No flag lifts one. --allow-incomplete lifts a gap only when every failed vote behind it failed in passing, and the change's own scan job can cause each of these: a change can crash its scanner, pad a report past its size or plant an entry that cannot be read. A gating profile's gap exits 4 and an advisory profile's is reported and exits nothing: Exit codes. The summary says the fix: check the report's path, and that the scan job wrote it for the reviewed commit for an unreadable report, see the gap in the report for a partial one and raise maxScannerIssues for a cap.
  • Not a gap: an issue on a file the change does not touch, on a line it does not touch, on a file the review already lists as left out with its own gap, or one its scanner or a person closed. Each is counted and none is read as a failure.
  • The limit of the scan itself. The scan job is the change's: it can leave an issue out of its report, and a dismissal cannot restore an issue that is not there, and a report that states no commit can be stale. A candidate judged by the panel is as strong as the panel; the report only says where a scanner looked: Threat model.

Suppressions ​

A change can silence a scanner without touching the code a scanner reads: it adds a comment the scanner takes as an order to skip a line, or it edits the file that lists what the scanner skips. Quorum reads both from the diff, by code, before any model sees it, and raises an advisory flag for each. A flag is a hint for a person who reads the result: it changes no verdict, no gap and no exit code, and no model is told of it.

  • suppression-added is raised for a file with an added line that holds a suppression marker, at the first such line, and counts them: flag: suppression-added at "src/db.js":12 (nosemgrep on 1 added line(s)). The marker is matched in any letter case and with no letter, digit or _ on either side, so # NoSemgrep is one and nosecure and my_noqa are not. The detail names the markers as the list below writes them, in the order they first stand in the file, at most eight and then and <k> more, and quotes nothing of the line. A removed or a context line raises none: only the lines a change adds are read.
  • scanner-config-edited is raised for a section of the diff that edits, renames, copies, adds or deletes an ignore or config file of a scanner, at the section's own path and with no line: flag: scanner-config-edited at ".trivyignore" (edits Trivy's ignore or config file). The detail names the first scanner of the list below that the section names, or, for the coverage tools, edits the coverage tools' ignore or config file.
  • A CI workflow raises scanner-config-edited too, but only while the review reads a report, a scanner's or a coverage report's: edits a CI workflow while the review reads a scanner or coverage report. The scan job and the test job run in a workflow, so a change to one can stop a job from writing the report this review reads, or leave out what it says. A review that reads no report has no job to protect, so it raises none for a workflow.

What each flag looks for ​

MarkerRead by
eslint-disable-next-line, eslint-disable-line, eslint-disableESLint
nosemgrepSemgrep
NOSONARSonarQube
@SuppressWarningsThe Java annotation analyzers read
nolintgolangci-lint
nosecgosec and Bandit
noqaflake8 and Ruff
pylint: disablePylint
rubocop:disableRuboCop
phpcs:ignorePHP_CodeSniffer
@phpstan-ignorePHPStan
gitleaks:allowgitleaks
pragma: allowlist secretdetect-secrets
checkov:skipCheckov
trivy:ignoreTrivy
kics-scan ignoreKICS
hadolint ignorehadolint

A longer marker is matched first, so eslint-disable-next-line is named once and eslint-disable, which it contains, is not named beside it.

ScannerFiles, in any directory unless a path is given
Trivy.trivyignore, .trivyignore.yaml, trivy.yaml, trivy.yml
Semgrep.semgrepignore, .semgrep.yml, .semgrep.yaml, and what is in a .semgrep directory
SonarQubesonar-project.properties, .sonarcloud.properties
ESLinteslint.config.*, .eslintrc*, .eslintignore
CodeQL.github/codeql/codeql-config.yml, .github/codeql/codeql-config.yaml, from the top of the repository
gitleaks.gitleaks.toml, .gitleaksignore
golangci-lint.golangci.*
hadolint.hadolint.yaml, .hadolint.yml
Checkov.checkov.yaml, .checkov.yml
Snyk.snyk
The coverage tools.nycrc*, .c8rc*, .coveragerc, codecov.yml, .codecov.yml
A CI workflow, while a report is read.github/workflows/*.yml and .github/workflows/*.yaml, from the top of the repository, and .gitlab-ci.yml

What a flag is not ​

  • A hint, never a defense. A marker split across two lines, a tool that reads a marker under another spelling, a file a tool is told to read by a flag, an ignore file under another name, and a scanner this list lacks are all missed. A flag says where a person should look, and a change that raises none is not thereby clean.
  • A path review raises neither. It reviews the files of a commit, not a change: its diff is written with every file as an added one, so nothing was added or edited, and a flag on each marker and each scanner file of the tree would bury the review's other flags. Its other flags are as they always were: The files at a commit.
  • The reading of a section's names is generous. scanner-config-edited reads the names a section writes, its own path, the words of its header and the paths its ---, +++, rename and copy lines give, with no hunk parsing, so it may be raised for a section whose hunk holds a row shaped like one of those lines: a removed row -- a/.snyk in a Markdown file reads as a --- line that names .snyk, and the flag is raised at that file. A rename away from a scanner's file raises it too, at the section's own path. It fails closed: a flag costs a person a look.
  • What they add to a report. A marker is no evidence that a scanner skipped the line, and a scan with no marker may still miss an issue: the report says what the scanner found, and these flags say what the change did to the scanner's inputs. Read together they show a person that a report's silence may be the change's own doing: Suppression markers and ignore files.
  • A suppression in a report is not honoured either. A SARIF result that a suppression marks is a candidate all the same, and its suppression is recorded and never obeyed: Reading a SARIF log. The same holds for the ignore files above: quorum never reads one to drop an issue.
  • The same words everywhere. Both flags are in meta.flags with the other advisory flags, after the guideline flags of the review (the scanner-config-edited ones last), in a flag event and in the flag: line, the text report, the Markdown summary and the MCP result: Advisory flags. The JSON holds the two codes: A flag.

A workflow with a scan job ​

The reference workflow reviews with no report. This one runs the scan first, in a job of its own, and hands what it wrote to the same review job: three jobs keep the pull request's code, the model key and the write token apart. The scan job runs the pull request's tests and Trivy with no secret, the review job holds the key and reads the reports as data, and the post job is the reference's, unchanged. A fork's pull request runs none of them.

yaml
name: Quorum

on:
  pull_request:

permissions: {}

env:
  QUORUM_VERSION: 0.16.0

jobs:
  scan:
    if: github.event.pull_request.head.repo.full_name == github.repository
    runs-on: ubuntu-latest
    timeout-minutes: 15
    permissions:
      contents: read
    steps:
    - name: Check out the pull request's head, with the history that holds the base
      uses: actions/checkout@v7
      with:
        ref: ${{ github.event.pull_request.head.sha }}
        fetch-depth: 0
        persist-credentials: false
    - name: Restore the scanners' settings from the base, and delete those it lacks
      env:
        BASE: ${{ github.event.pull_request.base.sha }}
      run: |
        set -euo pipefail
        specs=(
          ':(glob)**/.trivyignore'
          ':(glob)**/.trivyignore.yaml'
          ':(glob)**/trivy.yaml'
          ':(glob)**/trivy.yml'
          ':(glob)**/.semgrepignore'
          ':(glob)**/.semgrep.yml'
          ':(glob)**/.semgrep.yaml'
          ':(glob)**/.semgrep/**'
          ':(glob)**/sonar-project.properties'
          ':(glob)**/.sonarcloud.properties'
          ':(glob)**/eslint.config.*'
          ':(glob)**/.eslintrc*'
          ':(glob)**/.eslintignore'
          ':(glob).github/codeql/codeql-config.yml'
          ':(glob).github/codeql/codeql-config.yaml'
          ':(glob)**/.gitleaks.toml'
          ':(glob)**/.gitleaksignore'
          ':(glob)**/.golangci.*'
          ':(glob)**/.hadolint.yaml'
          ':(glob)**/.hadolint.yml'
          ':(glob)**/.checkov.yaml'
          ':(glob)**/.checkov.yml'
          ':(glob)**/.snyk'
          ':(glob)**/.nycrc*'
          ':(glob)**/.c8rc*'
          ':(glob)**/.coveragerc'
          ':(glob)**/codecov.yml'
          ':(glob)**/.codecov.yml'
        )
        git diff --name-only -z --no-renames --no-ext-diff --diff-filter=A "$BASE" HEAD -- "${specs[@]}" | xargs -0 -r rm --
        git diff --name-only -z --no-renames --no-ext-diff --diff-filter=DMT "$BASE" HEAD -- "${specs[@]}" | xargs -0 -r git checkout "$BASE" --
    - name: Install Trivy
      uses: aquasecurity/setup-trivy@81e514348e19b6112ce2a7e3ecbafe19c1e1f567 # v0.3.1
      with:
        version: v0.76.2
    - name: Scan the files with Trivy
      run: |
        mkdir -p "$RUNNER_TEMP/scan"
        trivy fs --format sarif --output "$RUNNER_TEMP/scan/trivy.sarif" .
    - uses: actions/setup-node@v7
      with:
        node-version: 24
    - name: Install the project's dependencies
      run: npm ci
    - name: Run the tests, with an lcov reporter
      run: npx vitest run --coverage --coverage.reporter=lcovonly --coverage.reportOnFailure --coverage.reportsDirectory="$RUNNER_TEMP/coverage"
    - name: Copy the tracefile into the scan directory
      if: ${{ !cancelled() }}
      run: |
        mkdir -p "$RUNNER_TEMP/scan"
        if [ -f "$RUNNER_TEMP/coverage/lcov.info" ]; then
          cp "$RUNNER_TEMP/coverage/lcov.info" "$RUNNER_TEMP/scan/lcov.info"
        fi
    - name: Keep the reports for the review job
      if: ${{ !cancelled() }}
      uses: actions/upload-artifact@v7
      with:
        name: quorum-scan
        path: ${{ runner.temp }}/scan
        retention-days: 1

  review:
    needs: scan
    if: ${{ !cancelled() && github.event.pull_request.head.repo.full_name == github.repository }}
    runs-on: ubuntu-latest
    permissions:
      contents: read
    outputs:
      result-id: ${{ steps.result.outputs.artifact-id }}
    steps:
    - name: Check out the base, with the history the range needs
      uses: actions/checkout@v7
      with:
        ref: ${{ github.event.pull_request.base.sha }}
        fetch-depth: 0
        persist-credentials: false
    - uses: actions/setup-node@v7
      with:
        node-version: 24
    - name: Install quorum
      run: npm install -g "@tobi-or-not/quorum@$QUORUM_VERSION"
    - name: Download the reports the scan job wrote
      continue-on-error: true
      uses: actions/download-artifact@v8
      with:
        name: quorum-scan
        path: ${{ runner.temp }}/scan
    - name: Review the pull request's commits
      env:
        BASE: ${{ github.event.pull_request.base.sha }}
        HEAD: ${{ github.event.pull_request.head.sha }}
        QUORUM_RESEARCH_PRESET: anthropic
        QUORUM_RESEARCH_MODEL: ${{ vars.QUORUM_MODEL }}
        QUORUM_RESEARCH_CONTEXT_TOKENS: ${{ vars.QUORUM_CONTEXT_TOKENS }}
        ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
      run: |
        exec quorum --range "$BASE...$HEAD" \
          --profile security --profile best-practices \
          --sarif security="$RUNNER_TEMP/scan/trivy.sarif" \
          --lcov "$RUNNER_TEMP/scan/lcov.info" \
          --view public -f brief --output json="$RUNNER_TEMP/quorum-result.json"
    - name: Keep the public view for the post job
      id: result
      if: ${{ !cancelled() }}
      uses: actions/upload-artifact@v7
      with:
        name: quorum-result
        path: ${{ runner.temp }}/quorum-result.json
        retention-days: 1

  post:
    needs: review
    if: ${{ !cancelled() && needs.review.result != 'skipped' }}
    runs-on: ubuntu-latest
    permissions:
      actions: read
      contents: read
      security-events: write
    steps:
    - name: Download the result the review job saved, by its artifact id
      if: ${{ needs.review.outputs.result-id != '' }}
      uses: actions/download-artifact@v8
      with:
        artifact-ids: ${{ needs.review.outputs.result-id }}
        path: ${{ runner.temp }}
    - uses: actions/setup-node@v7
      with:
        node-version: 24
    - name: Install quorum
      run: npm install -g "@tobi-or-not/quorum@$QUORUM_VERSION"
    - name: Render the summary and SARIF from the saved result
      run: |
        quorum report "$RUNNER_TEMP/quorum-result.json" -f brief \
          --output markdown="$RUNNER_TEMP/quorum-summary.md" --output sarif="$RUNNER_TEMP/quorum.sarif"
        cat "$RUNNER_TEMP/quorum-summary.md" >> "$GITHUB_STEP_SUMMARY"
    - uses: github/codeql-action/upload-sarif@v4
      with:
        sarif_file: ${{ runner.temp }}/quorum.sarif
        category: quorum
        ref: refs/pull/${{ github.event.pull_request.number }}/head
        sha: ${{ github.event.pull_request.head.sha }}

Set QUORUM_VERSION to the release you run: it must be one that reads reports, since the review job uses this page's flags. The scan and test steps are the example's: use your own install, test and scan commands, and any scanner that writes SARIF, as long as each report ends up under $RUNNER_TEMP/scan. The model variables are the reference workflow's, and the reasons for its review job, its post job and its pinning hold here too: A GitHub workflow.

The scan job ​

  • It runs the pull request's code and holds nothing. The tests, the install scripts and the files Trivy reads are the pull request's, so the job holds contents: read, no secret and no token left in the checkout (persist-credentials: false), and nothing it writes is trusted: a report is what the change made the job write, which is why the review job reads it as data.
  • It has a deadline. timeout-minutes ends a job whose pull request's code never returns, which would otherwise hold a runner for the workflow's default of six hours.
  • Its one third-party action is named by a commit. The installer of Trivy is aquasecurity/setup-trivy@<commit> # v0.3.1, with the tag in a comment, since a tag can be moved and the job runs the pull request's code beside it. The other actions keep their tags to keep the example short: pin them as the reference workflow says.
  • It checks out the head commit, not the merge commit. Without ref, a pull_request run checks out refs/pull/<number>/merge, a tree that is neither the base nor the head, so a report would give lines the review does not read. The review's range ends at the head, and a report that states another commit is refused: The commit. fetch-depth: 0 brings the base commit into the checkout for the next step.
  • It restores the scanners' settings from the base, and deletes those the base lacks, before it scans. A pull request can edit the file that tells a scanner what to skip, or add one the base never had, and the scan would read it. The list is the one the scanner-config-edited flag reads, each of the scanners' files as a pathspec (a name with no / in any directory, CodeQL's from the top): a file the change adds is deleted, and one it edits, deletes or changes the kind of is checked out again from the base. The names pass through -z, so no name is split or read as an option, and the step runs before any scanner and any test.
  • The scan directory, $RUNNER_TEMP/scan, holds what the review reads and nothing else, and lies outside the checkout: Trivy writes its SARIF there, before the install, so it scans the project's files and not its node_modules, with paths relative to the checkout, and a step after the tests copies the tracefile into it. Run every scanner before the install and the tests, as Trivy runs here: the restore step runs once, so an install script or a test can write an ignore file (a .semgrepignore, say) after it, and a scanner that ran later would read it. The tests write to a directory of their own, $RUNNER_TEMP/coverage, since Vitest empties its reports directory before it runs, which would delete the Trivy report, and its lcovonly reporter writes the tracefile with no HTML report beside it. A runner of another kind goes the same way: it writes wherever it likes, and the copy step takes its lcov.info into the scan directory, its source path ($RUNNER_TEMP/coverage/lcov.info above) following the runner's output directory. Both jobs check the repository out to the runner's default directory, so the paths place against the review's top level and the review needs no --scan-root: The paths. A runner or a scanner that scans in a container names its own root: --scan-root /src.
  • The copy and the upload run whatever happened (!cancelled()), and the tests write their tracefile on a failure too (--coverage.reportOnFailure, which Vitest leaves off by default), so a failing test run still hands over its coverage and the Trivy report, which is written before the tests run. A project that tests with another runner writes its tracefile with that runner's own flags, and any runner that writes lcov is read the same way: Test coverage.

The review job ​

  • It is the reference's review job, after the scan: the base checkout with no token, the key, the public view, exec and the result in $RUNNER_TEMP: The review job. The reports it reads are in $RUNNER_TEMP/scan, outside its checkout, and it reads them as data and never as configuration: What quorum reads, and never runs.
  • A scan job that crashed costs its report and never the review. The job runs after a failed scan (!cancelled()), and the download carries continue-on-error, so a missing artifact leaves the review to run and the missing report to be a gap: report-unreadable, the file does not exist. A gating profile exits 4 and --allow-incomplete lifts none: The limits and the gaps. The scan job's own failure is its own red check.
  • Each --sarif names its profile, because two profiles run: --sarif security=... feeds security and no other. Name any other profile the same way, as --sarif best-practices=..., and feed a second scanner by another flag, such as a Semgrep report written with semgrep scan --sarif --output "$RUNNER_TEMP/scan/semgrep.sarif" and read with --sarif security="$RUNNER_TEMP/scan/semgrep.sarif": The formats and the flags. --lcov takes a path alone, since a tracefile feeds every profile that reads test coverage: with security alone running it is a configuration error, so a workflow that runs no best-practices leaves it out.
  • --profile repeats to run several profiles, each its own panel: security is gating and best-practices advisory, so a gap of the second never fails the job: Profiles.

What the workflow settles ​

  • A fork's pull request runs none of the three jobs. The scan job's if skips a fork's, and so does the review job's: no fork's code meets the scan job or the key, and the workflow never uses pull_request_target. A maintainer reviews a fork from a clone of their own: A pull request from a fork.
  • No job holds two of the three: the pull request's code, the model key and the write token. The scan job runs the code and holds nothing, the review job holds the key and runs none of it, and the post job holds the write token and a result: The CI workflow.
  • The post job takes the review job's result by its artifact id, never by a name. The scan job runs the pull request's code, and a process it starts, an install script of a dependency say, can read the job's runtime token and create an artifact of any name. One named quorum-result makes the review job's upload fail on the duplicate, and a download by that name would hand the post job its file, which it would render and send to code scanning with security-events: write: a repository gated by code scanning merge protection, not by the review job, would merge on a forged "no findings". So the review job's upload step has an id, the job exports the upload's artifact-id as result-id, and the post job downloads that id, which no artifact the scan job made has: A saved result as input. A download of one id extracts into path itself, as a download by name does, so quorum report reads the same file. An empty result-id, because the upload failed or the review wrote no result, skips the download, since an empty artifact-ids makes the action download every artifact of the run, and the post job then fails at quorum report, which finds no file. The review job downloads quorum-scan by name, which costs nothing: that artifact is the pull request's data whoever made it.
  • Every value reaches a script through env:. No run: holds a ${{ }} expression, the restore step's $BASE included.
  • What the restore step covers. The files of the list above, and nothing else: a scanner that reads its settings from package.json or pyproject.toml, from a flag or a variable of the workflow or from a marker in the code is not restored, and a scanner this list lacks is not either. The flags say where a person should look: Suppressions.
  • The workflow is the pull request's too. A pull request from this repository runs its own copy of the workflow, so it can edit every job and not only the scan job, the review job's key and the post job's token included, or stop it. The same-repository author is trusted with the key, as with the reference workflow: the three jobs keep the pull request's code away from the key and the token, never its author. A change to a workflow raises scanner-config-edited while the review reads a report, so a person reads it, and the review cannot know what the job did: Suppressions.
  • The tests and the scan are the change's. A tracefile says which lines the tests ran and a report says what a scanner found, both as the change's own job wrote them: the panel weighs each as evidence and no code decides on one, and neither says the change is right. What a coverage report cannot say and the threat model say what remains.

Next ​

Test coverage — what an lcov tracefile tells the review of the lines a change adds, which profile and which lens receive it, and what it can never say.

Released under the MIT License.