Write SBOM environment bundle metadata for an R package repo
write_sbom_env.RdWrites a lightweight environment manifest and copies the specified renv.lock
into an SBOM artifact bundle directory (default: artifacts/sbom).
Usage
write_sbom_env(
lockfile = "renv.lock",
out_dir = file.path("artifacts", "sbom"),
overwrite = TRUE,
quiet = FALSE
)Details
This function is intended to be called from CI after renv::restore() and SBOM
generation steps (e.g., Anchore SBOM Action). It does not generate the SBOM
itself; it creates additional evidence that documents the environment associated
with the SBOM artifact.
Files written:
<Package>_env_sha-<shortsha>.txt: environment manifest (Package/Version, git SHA, R version/platform, timestamp, lockfile hash)renv.lock: copy of the lockfile used