Skip to content

Continuous integration

iomi edited this page Nov 25, 2026 · 30 revisions

Continuous integration

Reusable pull-request workflow

Copy examples/github-action.yml or add the job directly:

name: dependency review
on: pull_request

permissions:
  contents: read
  pull-requests: write

jobs:
  dep-vet:
    uses: nassih-yassine/Dep-Vet/.github/workflows/dep-vet.yml@v0.16.0
    with:
      lockfile: package-lock.json
      ref: v0.16.0

The workflow checks out with full history, installs dep-vet, diffs the lockfile against origin/<base>, and keeps one comment updated on the pull request.

Exit Job
0 clean pass
1 warnings pass, findings in the comment
2 high risk fail
3 could not check fail

Inputs: lockfile (default package-lock.json), base (defaults to the PR base branch), and ref (default v0.16.0). They are passed as quoted environment values, so paths with spaces work.

uses: pins the workflow file, not the binary. Keep ref on a tag you reviewed. The job replaces .depvet.toml with the base revision's copy (or removes it) before dep-vet lock, so a pull request cannot allowlist or loosen its own policy.

Long reports are truncated in the comment (GitHub rejects bodies over 65,536 characters), but the full output lands in the job log and the step summary. A read-only token (Dependabot or fork PRs) prints a warning and keeps the summary instead of failing the audit.

SARIF instead

- run: dep-vet audit package-lock.json --format sarif -o results.sarif
- uses: github/codeql-action/upload-sarif@v3
  with:
    sarif_file: results.sarif

SARIF maps High to error, Warn to warning, and Info to note. The artifact location is the lockfile; fingerprints are rule:name@version.

Dogfooding

CI audits Cargo.lock and scans dep-vet's own hand-written workflows and MCP configs on every push. Warnings fail the build. The generated release.yml is printed to the step summary instead of failing, because cargo-dist pipes two installers by design.

Real risks are fixed, not allowlisted: an unmaintained transitive dependency (unsafe-libyaml) was removed. Reviewed exceptions live in .depvet.toml with a reason and stay visible as [ALLOWED].

The same checks run locally in pre-commit (staged lockfiles) and pre-push (fmt, clippy, tests, workflow and MCP scans). Enable once per clone:

git config core.hooksPath .githooks

Weekly npm seed refresh

.github/workflows/refresh-popular.yml regenerates the download-ranked npm candidate list every Monday at 04:00 UTC, or on demand. It refuses a diff over 200 lines or a seed that lost an ANCHORS entry, validates with cargo test, pushes bot/refresh-popular-npm, opens or updates a PR, enables auto-merge, and approves the bot PR's parked CI run.

Roll your own job

name: dependency review
on: pull_request

permissions:
  contents: read
  pull-requests: write

jobs:
  dep-vet:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@<full-commit-sha>
        with:
          fetch-depth: 0
      - run: cargo install dep-vet --locked
      - run: dep-vet lock package-lock.json --base origin/${{ github.base_ref }}

Install a reviewed tag, not a moving branch. The binary is what runs; the workflow file's uses: ref does not pin it.

Clone this wiki locally