SarifReporter

Generates a SARIF 2.1.0 report from rule engine results.

SARIF (Static Analysis Results Interchange Format) is the format GitHub uses for code scanning. When aalekh-results.sarif is uploaded as a GitHub Actions artifact with the github/codeql-action/upload-sarif action, violations appear as inline annotations on pull request diffs - no custom reporter or token needed.

GitHub Actions integration

- name: Run Aalekh
run: ./gradlew aalekhCheck

- name: Upload SARIF results
uses: github/codeql-action/upload-sarif@v3
if: always()
with:
sarif_file: build/reports/aalekh/aalekh-results.sarif

The if: always() ensures annotations are posted even when aalekhCheck fails.

Functions

Link copied to clipboard