Loading
Connect a repository
in your repository
npm i -D mlreps.github/workflows/mlreps.yml
name: MLReps
on:
push:
branches: [main]
jobs:
scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# Without this the scan reports that every file was never committed.
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 24
- run: npm ci
- run: npx mlreps scan . --publish
env:
MLREPS_KEY: ${{ secrets.MLREPS_KEY }}
Add the key as a repository secret named MLREPS_KEY. The endpoint is /api/scan/v1/report, and the response to every publish is the diagnostic: what we stored, what we could not read, and what was swept out of it.
.github/workflows/codebase.yml
name: Codebase intelligence
on:
pull_request:
# Without this, GITHUB_TOKEN cannot write a check run and every run ends in a 403.
permissions:
contents: read
checks: write
jobs:
scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- run: npm ci
- run: npx mlreps check .
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# On a pull request, GITHUB_SHA is a merge commit that exists nowhere in
# the repository — a check run posted against it is invisible.
PLATFORM_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
Nothing above is specific to Actions beyond the check run. On GitLab, Bitbucket, Jenkins or a laptop, set these two and run npx mlreps scan . --publish.
environment
MLREPS_KEY=<your project key>
MLREPS_ENDPOINT=https://dev.mlreps.comAdd --dry-run to see exactly what would be sent without sending it. A checkout with no remote is refused rather than guessed at — a scan has to be filed under a repository name, and a folder name is not one.