Skip to content

Connect applications and CI

PatchTrail uses committed dependency files to assess a repository and software bills of materials (SBOMs) to assess builds. Connect both if you need to trace a dependency update from merge to production.

In the console, connect the read-only PatchTrail GitHub App and select the repositories to observe. PatchTrail refreshes selected lockfiles from the default branch and records the exact commit it assessed. Use Dependabot or Renovate to open dependency updates. A merge to the default branch triggers a new repository assessment.

Install patchtrail from the CLI package and put the supported OSV-Scanner version on your PATH. The following command refreshes advisory databases as needed and scans a lockfile.

Terminal window
patchtrail scan --lockfile package-lock.json --download-databases

Run patchtrail scan --help for supported inputs and output formats. Local scans can run without a PatchTrail account.

Generate a CycloneDX JSON SBOM for the built artifact. Use a protected runner secret named PATCHTRAIL_API_KEY. For an enrolled CI asset, give the key inventory:write for the exact team and asset. Set TEAM_ID and ASSET_ID to the enrolled values, BUILD_SEQUENCE to an increasing number for that asset, and supply the full Git commit and exact platform manifest digest.

Terminal window
patchtrail ci submit --team "$TEAM_ID" --asset "$ASSET_ID" \
--sequence "$BUILD_SEQUENCE" --commit "$GIT_COMMIT" \
--image-digest "$IMAGE_DIGEST" --report image.cdx.json

The receipt means PatchTrail accepted the report for assessment. To verify a deployment, compare that digest with a current runtime observation from Kubernetes.

For GitLab, patchtrail ci on a runner can submit the committed lockfiles from a default-branch push. Set a masked, protected PATCHTRAIL_API_KEY with Publish build inventory for the selected team. The CLI checks the remote default branch before it submits the files.