PackageMedicDocs
Continuous integration

Put diagnostics beside the change.

The official action performs one analysis, creates JSON and SARIF, annotates files, writes a job summary, uploads optional artifacts, and preserves the CLI exit code.

Recommended pull-request workflow

GitHub Actions YAML
permissions:
  contents: read
  security-events: write

steps:
  - uses: actions/checkout@v6
    with:
      fetch-depth: 0
  - uses: GonzMeza/package-medic@v0.6.1
    with:
      path: .
      audit: 'true'
      include-transitive-audit: 'true'
      deprecated: 'true'
      include-transitive-deprecated: 'true'
      fail-on: warning
      annotations: new
      upload-sarif: 'true'
      upload-artifact: 'true'

Key inputs

InputDefaultPurpose
path.Project, solution, slnx, or directory inside GITHUB_WORKSPACE.
tool-version0.6.1Exact PackageMedic.Tool version; wildcards are rejected.
restoretrueRestore before analysis.
configunsetRepository-relative PackageMedic configuration.
baselineunsetRepository-relative portable baseline.
modeautoUse unprivileged pull_request diff automatically, or force scan / diff.
fail-on / fail-on-newunsetOverride policy thresholds when supplied.
auditfalseRequest official NuGet vulnerability evidence.
include-transitive-audittrueInclude transitive packages after audit is enabled.
deprecatedfalseRequest official NuGet deprecation evidence.
include-transitive-deprecatedfalseInclude transitive deprecated packages.
diff-baseunsetReachable Git ref that overrides mode.
verifyunsetIn diff mode, require immutable restore, build, or test evidence.
build-timeout900Bound each generated build target in seconds.
test-timeout1200Bound each generated test project in seconds.
verification-configurationReleaseConfiguration shared by verified build and test stages.
annotationsnewEmit new, all, or no native file annotations.
upload-sariftrueUpload deterministic SARIF to Code Scanning.
upload-artifacttrueRetain JSON and SARIF for 14 days.
max-parallelismautomatic, up to 4Bound concurrent restore, audit, and MSBuild work.

Outputs and isolation

Later steps can read exit-code, json-file, sarif-file,errors, warnings, information, package direction counts, PM007/PM008 introduced/resolved/persistent counts, artifact-name, and sarif-category. Every action invocation gets an isolated report directory, artifact name, and SARIF category so repeated scans cannot overwrite each other.

Pull-request comparisons additionally expose impact-gate-passed,impact-violations, impact-added-direct,impact-added-transitive, impact-max-blast-radius, andimpact-source-changes, and impact-content-changes. The job summary lists failed PMI policies and their causal dependency paths.

Verified comparisons additionally expose verification-status, build/test regression flags, candidate test counts, verification-incomplete,sbom-file, sbom-created, provenance-file, andprovenance-created.

Pull-request graph diff

GitHub Actions YAML
- uses: actions/checkout@v6
  with:
    fetch-depth: 0

- uses: GonzMeza/package-medic@v0.6.1
  with:
    audit: 'true'
    deprecated: 'true'
    fail-on: warning

Auto mode uses the base SHA for an unprivileged pull_request event and rejectspull_request_target, whose default checkout would compare the base against itself. Fetch enough history so the base already exists locally; PackageMedic never fetches or changes Git. diff-base is an explicit override. Diff rejects baseline and fail-on-new because the Git comparison already defines which findings are new.

The same run evaluates the committed impact configuration. A policy failure returns exit code 1 even when diagnostic fail-on isnone; an incomplete base or current graph returns 2.

PackageMedic 0.6 also implements opt-in immutable restore, build, and test comparison. Its runner policy and evidence outputs are documented under Verified experiments.

Action security boundaries

  • The default tool source is exclusively NuGet.org.
  • Offline local sources are accepted only inside the workspace or runner temporary directory.
  • Scan, configuration, baseline, and output paths cannot escape their allowed roots.
  • Report files are size-checked before JavaScript parses them.
  • Custom artifact, category, and output values are validated before use.